K-Nearest Neighbor from Scratch in Python

preview_player
Показать описание
K-Nearest Neighbor is a simple machine learning algorithm that is intuitive and easy to learn. Watch here how I code one from scratch in Python! 🐍

# Table of Content
- Introduction: 0:00
- Theory: 1:50
- Scikit-Learn Implementation: 3:44
- Python Implementation: 7:08
- Conclusion: 11:24

KNN is a very simple algorithm for classification, wikipedia define it as so:

"In k-NN classification, the output is a class membership. An object is classified by a plurality vote of its neighbors, with the object being assigned to the class most common among its k nearest neighbors (k is a positive integer, typically small). If k = 1, then the object is simply assigned to the class of that single nearest neighbor."

Which means that the label of a given point is given by it's k nearest neighbor as define by a distance metric. The parameter k is the only parameter that one needs to tweak in order to fit the data!

Just check to README to figure out the exact location of the code. When I refactor the folder structure something it breaks the link so I prefer to just link the repository.

----

----
Follow Me Online Here:

___

Have a great week! 👋
Рекомендации по теме
join shbcf.ru