Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in Machine Learning by (55.6k points)

Can anyone explain the KNN algorithm in the simplest terms?

1 Answer

0 votes
by (119k points)

KNN (K-nearest neighbors), also called the laziest algorithm, is a supervised learning algorithm that can be used for classification and regression. In KNN, we have to initialize the hyperparameter K in the starting. Later KNN algorithm calculates the distance between all the examples or observations of the training dataset with the current example in the testing dataset. After that, the KNN algorithm picks examples with the highest K distances. If it is a regression problem, then the algorithm calculates the mean of K classes. If it is a classification task, then the algorithm calculates the mode of K classes.

You can register in this Machine Learning Online Course by Intellipaat which has experienced instructors, best curriculum, and projects.

Also, watch this video on Machine Learning Algorithms:

Browse Categories

...