What is KNN algorithm?

0 votes
What is KNN algorithm? Can you explain with an example? Thank you..
May 13 in Machine Learning by Minakshi
28 views

1 answer to this question.

0 votes

KNN which stand for K Nearest Neighbor is a Supervised Machine Learning algorithm that classifies a new data point into the target class, depending on the features of its neighboring data points. 

Let’s try to understand the KNN algorithm with a simple example. Let’s say we want a machine to distinguish between images of cats & dogs. To do this we must input a dataset of cat and dog images and we have to train our model to detect the animals based on certain features. For example, features such as pointy ears can be used to identify cats and similarly we can identify dogs based on their long ears.

After studying the dataset during the training phase, when a new image is given to the model, the KNN algorithm will classify it into either cats or dogs depending on the similarity in their features. So if the new image has pointy ears, it will classify that image as a cat because it is similar to the cat images. In this manner, the KNN algorithm classifies data points based on how similar they are to their neighboring data points.

answered May 13 by Jinu

Related Questions In Machine Learning

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Example to run KNN algorithm using python

Have a look at this one: from sklearn.datasets ...READ MORE

answered May 8 in Machine Learning by Harvy
74 views
0 votes
1 answer
0 votes
1 answer

Features of KNN algorithm

The KNN algorithm has the following features: KNN ...READ MORE

answered May 13 in Machine Learning by Vedant
55 views
0 votes
2 answers

What is supervised learning?

Supervised learning is the machine learning task ...READ MORE

answered Sep 3 in Data Analytics by anonymous
• 25,580 points
27 views
0 votes
0 answers

What is semi-supervised machine learning?

What is semi-supervised machine learning? READ MORE

May 8 in Machine Learning by Ganesh
18 views
0 votes
1 answer
0 votes
1 answer

What is Unsupervised Learning?

Unsupervised Learning is the training of machine ...READ MORE

answered May 8 in Machine Learning by Alok
28 views
0 votes
1 answer

What is clustering in Machine Learning?

Clustering is a type of unsupervised learning ...READ MORE

answered May 9 in Machine Learning by Shridhar
51 views