K-Nearest Neighbors A Simple Yet Powerful Machine Learning Algorithm

KNN for Claasification:

Binary Classification Data Points Distribution Example

How does KNN work?

Binary Classification using KNN with K=3

Failure Cases of KNN:

Query point q is very far from all the classes
Mixed data points of binary classes

Distance Measures:

Formula to calculate the Euclidean Distance between two points in 2D and N-D
Formula to calculate the Manhattan Distance between two points in 2D in N-D
Formula to calculate Minkowski Distance
sklearn KNeighborsClassifier Class Parameters

Overfitting and Underfitting Cases in KNN:

Overfitting Condition in KNN

Regression in KNN:

Limitations of KNN:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store