K-Nearest Neighbors

Intuition behind the algorithm :

How do we Decide Value of K?

1.Training error Rate 2.Validation Error Rate

Which value is the nearest value i.e which distance metrics can be used?

Applications of KNN :

  • If you’re searching for semantically similar documents (i.e., documents containing similar topics), this is referred to as Concept Search.
  • The biggest use case of K-NN search might be Recommender Systems. If you know a user likes a particular item, then you can recommend similar items for them.

Advantages :

  • No assumptions about data — useful, for example, for nonlinear data
  • Simple algorithm — to explain and understand/interpret
  • High accuracy (relatively) — it is pretty high but not competitive in comparison to better supervised learning models
  • Versatile — useful for classification or regression

Disadvantages :

  • Computationally expensive — because the algorithm stores all of the training data
  • High memory requirement
  • Prediction stage might be slow (with big N)
  • Sensitive to irrelevant features and the scale of the data.




Learning how machines learn!!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

No Code Data Enhancement with Azure Synapse Analytics and Azure Auto ML

Announcing PyCaret 2.0

Basics of Exploratory Data Analysis for Machine Learning

Image Inpainting: Humans vs. AI

Linear Methods of Classification

Do You Speak Argot? Capturing Slang on Twitter with Expert.ai

Neural ODEs with PyTorch Lightning and TorchDyn

Using TensorFlow for Crypto

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
Srishti Sawla

Srishti Sawla

Learning how machines learn!!

More from Medium

Intuition about Correlation coefficient

Evaluation of Classification Model

Medical Insurance Charges Prediction — Linear Regression, SGD Regressor, Random Forest

Choosing the Right Evaluation Metric