K Nearest Neighbor Terms Flashcards
It is the most naive kind of supervised machine learning
K Nearest Neighbor Algorithm (KNN)
What does KNN predict?
based on similarity to its closest neighbors
Why KNN does not need much training?
KNN simply memorizes the entire dataset
How does KNN predict?
Find the most similar object and copy its label
What distance or measurement does KNN use when making a prediction?
Euclidean or Manhattan distance
What is the hyperparameter K?
option that you manually decide on when making a prediction
In the hyperparameter k, what does K represent?
number of nearest neighbors to consider before making a prediction
If we use knn on classification types, how does the algorithm decides on the final prediction?
decides through majority (mode)
If we use knn on regression types, how does the algorithm decides on the final prediction?
decides through average (median)
when we use KNN, what factors can we consider on Features and Labels?
Features can be either discrete or continuous.
Labels can be classification or regression.
what are the advantages of KNN?
Fast training time, and easy to implement
what are the disadvantages of KNN?
model is large, prediction is slow if the dataset is too big, and treats all features equally even if they are relevant or not.