Introduction to AI Flashcards
(13 cards)
What is the NEarest Neighbour Classifier?
New test data is classified by calculating the distance to the nearest neighbour, it then is classified the same as this neighbour
what is the formula for Euclidean Distance? (2,5) to (6,8)
sqrt((2-6)^2 + (5-8)^2) = sqrt(25) = 5
what is the formula for Manhattan Distance? (2,5) to (6,8)
2-6 + 5-8 = 4 + 3 = 7
What is K Nearest Neighbour Classifier?
Takes K - Nearest Points instead of only one and the majority label becomes the classifier of the training data
How do we calculate classification accuracy?
(No. of correction predictions / total tested patterns) x 100
Describe K Means Clustering Algorithm
Choose Centroids at random,
Assign each data point to its closest cluster(compute distance)
Calculate new cluster centre (mean position of points in cluster)
Repeat algorithm until centroids converge
What is an individual in the Genetic Algorithm
Representative of a candidate solution to the problem the algorithm is trying to solve
What is a fitness function?
Evaluates how useful or close to the solution the candidate solution is.
Describe the general structure/flow of a genetic algorithm
Create Population - Compute Fitness - Select Best Individuals - Modify best individuals - compute fitness of offspring - stop - return best individual
What are individuals in the Simple Genetic Algorithm
Binary Strings
What are the two operators involved in the Genetic Algorithm?
CrossOver - divide both bits in half and swap vertically
Mutation - Change one of the bits to 0 or 1
How is reproduction done in the genetic algorithm?
After fitness is calculated, percentages are used to construct a chance wheel. Then it is spun so the population remains the same, but new parents are created