Member-only story

K Nearest Neighbours Explained

Understand the KNN algorithm and its implementation in Python using the sklearn library

Vatsal
Towards Data Science
4 min readJan 11, 2021
Image from : https://unsplash.com/photos/lW25Zxpkln8

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…

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Towards Data Science
Towards Data Science

Published in Towards Data Science

Your home for data science and AI. The world’s leading publication for data science, data analytics, data engineering, machine learning, and artificial intelligence professionals.

No responses yet

What are your thoughts?