artificial-intelligence

Error in Confusion Matrix : the data and reference factors must have the same number of levels

余生长醉 提交于 2019-11-26 14:28:24
问题 I've trained a Linear Regression model with R caret. I'm now trying to generate a confusion matrix and keep getting the following error: Error in confusionMatrix.default(pred, testing$Final) : the data and reference factors must have the same number of levels EnglishMarks <- read.csv("E:/Subject Wise Data/EnglishMarks.csv", header=TRUE) inTrain<-createDataPartition(y=EnglishMarks$Final,p=0.7,list=FALSE) training<-EnglishMarks[inTrain,] testing<-EnglishMarks[-inTrain,] predictionsTree <-

How do 20 questions AI algorithms work?

不问归期 提交于 2019-11-26 12:35:13
问题 Simple online games of 20 questions powered by an eerily accurate AI. How do they guess so well? 回答1: You can think of it as the Binary Search Algorithm. In each iteration, we ask a question, which should eliminate roughly half of the possible word choices. If there are total of N words, then we can expect to get an answer after log2(N) questions. With 20 question, we should optimally be able to find a word among 2^20 = 1 million words. One easy way to eliminate outliers (wrong answers) would

Why is Lisp used for AI? [closed]

删除回忆录丶 提交于 2019-11-26 12:34:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I\'ve been learning Lisp to expand my horizons because I have heard that it is used in AI programming. After doing some exploring, I

What is the optimal algorithm for the game 2048?

纵然是瞬间 提交于 2019-11-26 12:33:35
I have recently stumbled upon the game 2048 . You merge similar tiles by moving them in any of the four directions to make "bigger" tiles. After each move, a new tile appears at random empty position with a value of either 2 or 4 . The game terminates when all the boxes are filled and there are no moves that can merge tiles, or you create a tile with a value of 2048 . One, I need to follow a well-defined strategy to reach the goal. So, I thought of writing a program for it. My current algorithm: while (!game_over) { for each possible move: count_no_of_merges_for_2-tiles and 4-tiles choose the

Einsteins Riddle Prolog

╄→гoц情女王★ 提交于 2019-11-26 12:33:01
问题 I need some help with a prolog homework for my AI class. The question is to write prolog code for einstein\'s puzzle. I know how to write it down in my own but there are some constraints in the homework. there are 5 houses the Englishman lives in the red house the Spaniard owns the dog coffee is drunk in the green house the Ukrainian drinks tea the green house is immediately to the right of the ivory house the Old Gold smoker owns snails Kools are smoked in the yellow house milk is drunk in

How to recognize rectangles in this image?

自古美人都是妖i 提交于 2019-11-26 12:23:13
问题 I have a image with horizontal and vertical lines. In fact, this image is the BBC website converted to horizontal and vertical lines. My problem is that I want to be able to find all the rectangles in the image. I want to write a computer program to find all the rectangles. Does anyone know how to do this or suggest ideas on how to get started? This task is easy for me as a person to find the visual rectangles, but I am not sure how to describe it as a program. Image is the BBC website here

Why should weights of Neural Networks be initialized to random numbers?

徘徊边缘 提交于 2019-11-26 12:16:35
问题 I am trying to build a neural network from scratch. Across all AI literature there is a consensus that weights should be initialized to random numbers in order for the network to converge faster. But why are neural networks initial weights initialized as random numbers? I had read somewhere that this is done to \"break the symmetry\" and this makes the neural network learn faster. How does breaking the symmetry make it learn faster? Wouldn\'t initializing the weights to 0 be a better idea?

Clustering Algorithm for Mapping Application

时光怂恿深爱的人放手 提交于 2019-11-26 12:11:40
问题 I\'m looking into clustering points on a map (latitude/longitude). Are there any recommendations as to a suitable algorithm that is fast and scalable? More specifically, I have a series of latitude/longitude coordinates and a map viewport. I\'m trying to cluster the points that are close together in order to remove clutter. I already have a solution to the problem (see here), only I am wondering if there is any formal algorithm that solves the problem efficiently. 回答1: For a virtual earth

Good beginners material on Prolog [closed]

醉酒当歌 提交于 2019-11-26 10:05:54
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Locked . This question and its answers are locked because the question is off-topic but has historical significance. It is not

What is the best Battleship AI?

女生的网名这么多〃 提交于 2019-11-26 10:04:10
问题 Battleship! Back in 2003 (when I was 17), I competed in a Battleship AI coding competition. Even though I lost that tournament, I had a lot of fun and learned a lot from it. Now, I would like to resurrect this competition, in the search of the best battleship AI. Here is the framework, now hosted on Bitbucket. The winner will be awarded +450 reputation! The competition will be held starting on the 17th of November, 2009 . No entries or edits later than zero-hour on the 17th will be accepted.