> For the complete documentation index, see [llms.txt](https://haroldyin.gitbook.io/grokking-algorithm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://haroldyin.gitbook.io/grokking-algorithm/chapter-10-k-nearest-neighbors.md).

# Chapter 10: K-nearest neighbors

KNN—classification and regression:

* Classification = categorization into a group
* Regression = predicting a response (like a number)

**Cosine similarity**

* Cosine similarity doesn’t measure the distance between two vectors.
* Instead, it compares the angles of the two vectors.
