Inspiration
I got inspired of writing about this basic KNN algorithm through motivation towards the world of ML & AI.
What it does
It just describes what is KNN algorithm.
Description of K- Nearest Neighbour Algorithm
It is a brute force algorithm as we compare point with every point. In this:
- First we take the distances of given point from the every point in every cluster.
- We get something like this { [2,Y],[5,R],[3,G],[1,R],[4,Y],[2,R],[6,G],[4,R] }
- Sort the distances
- Not it looks like this { [1,R],[2,R],[2,Y],[3,G],[4,R],[4,Y],[5,R],[6,G] }
- Now choose some top K cases, like we took K=5
- Now we find the most occurring cluster, here it is R. See figure for reference.
Challenges we ran into
This algorithm is basically "hello world" algorithms of Machine Learning. It is used to compare models with other algorithms implemented to compare accuracy of our ML model.
Built With
- ml
Log in or sign up for Devpost to join the conversation.