Sitemap
TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

K Nearest Neighbours Explained

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

4 min readJan 11, 2021

--

Press enter or click to view image in full size
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…

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.