KNN algorithm

Naman Mehra
Jul 2, 2021

KNN- K Nearest Neighbors, is one of the simplest Supervised Machine Learning algorithm mostly used for Classification. It classifies a data point based on how its neighbors are classified. KNN stores all available cases and classifies new cases based on a similarity measure.

K in KNN is a parameter that refers to the number of nearest neighbors to include in the majority voting process. Choosing the right value of k is a process called parameter tuning, and is important for better accuracy. We can choose k as sqrt(n), where n is the total number of data points, and also k should be odd.

Implementation of KNN from scratch link.

--

--