1
$\begingroup$

Does anyone know if there is a difference between K nearest neighbor (KNN) and nearest neighbor algorithm (NN)? And if they are how are they different?

So far all I know is that NN is unsupervised learning while KNN is supervised learning.

$\endgroup$
1
  • $\begingroup$ When you say "NN is unsupervised learning", are you reading NN as neural networks rather than nearest neighbours? $\endgroup$
    – Henry
    Jun 16 at 11:21

1 Answer 1

0
$\begingroup$

Nearest Neighbors (NN) is a catch-all term for a whole family of methods that use search among the neighbors for different purposes. Scikit-learn named a whole module like this. $k$NN is a regression and classification algorithm that works by searching the database to find $k$ points the most similar to an example and average them to make the prediction. The other use may be in a content-based recommender system, where we are searching for some number of similar products to present them as recommendations. In both cases, we use the nearest neighbors search as a workhorse. Also, keep in mind that it is not a single algorithm, but there are multiple algorithms and their implementations for it, including exact and approximate ones (e.g. Spotify's Annoy).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.