Member-only story
K Nearest Neighbours Explained
Understand the KNN algorithm and its implementation in Python using the sklearn library
In this article I will give a general overview, implementation, drawbacks and resources associated with the K Nearest Neighbours algorithm. Supervised learning is a subsection of machine learning generally associated with classification and regression based problems. Supervised learning implies that you are training a model using a labelled dataset. K Nearest Neighbours (KNN) falls under the supervised learning umbrella and is one of the core algorithms in machine learning. It’s a highly used, simple yet efficient example of a non-parametric, lazy learner classification algorithm.
- Lazy Learner implies that it doesn’t learn a discriminative function from the training data but rather memorizes the training data instead
- Non-parametric implies that the algorithm makes no assumptions about the distribution of the data.
The KNN algorithm classifies unclassified data points based on their proximity and similarity to other available data points. The underlying assumption this algorithm makes is that similar data points can be found near one another. It’s commonly used to solve problems in various industries because of its ease of use, application to classification and regression…