difference between classification and regression in k-nearest neighbor

0 votes
what is the difference between using K-nearest neighbor in classification and using it in regression?

and when using KNN in recommendation system. Does it concerned as classification or as regression?
Mar 3, 2022 in Machine Learning by Nandini
• 5,480 points
2,683 views

1 answer to this question.

0 votes
In classification tasks, the user tries to predict a category, which is commonly represented as an integer label but actually represents a group of "objects." You could, for example, use label 0 for "Rat" and 1 for "Cat" to categorize photographs into "Rat" and "Cat" categories.

The KNN classification algorithm will look at the k closest neighbors of the input you're trying to predict. The most common label among the k samples will then be output.

The user wishes to get a numerical value out of regression tasks (usually continuous). For example, it could be used to determine the value of a home or to rate the quality of a film.
In this situation, the KNN method would combine the values associated with the k nearest examples from the one on which you wish to make a prediction to produce a single value. Normally, the average of the neighbors' k values would be used, however the median or a weighted average might also be used (or actually anything that makes sense to you for the task at hand).

You could use both for your problem, but I think regression makes more sense for predicting some sort of "matching %"" between the user and the object you want to recommend to him.
Also K NN is a lazy learner as it learns via instances and also known as instance based learning.
Might become slow with large data set.
answered Mar 4, 2022 by Dev
• 6,000 points

Related Questions In Machine Learning

0 votes
1 answer

Difference between classification and regression score in Python scikit learn

Classification Score is used for discrete values ...READ MORE

answered Feb 24, 2022 in Machine Learning by Nandini
• 5,480 points
609 views
0 votes
1 answer
0 votes
0 answers

Difference between classification and regression, with SVMs

What is the exact difference between a ...READ MORE

Feb 28, 2022 in Machine Learning by Dev
• 6,000 points
773 views
0 votes
1 answer

What is the difference between linear regression and logistic regression?

Hi Dev, to answer your question Linear Regression ...READ MORE

answered Feb 2, 2022 in Machine Learning by Nandini
• 5,480 points
1,183 views
0 votes
1 answer

Use different distance formula other than euclidean distance in k means

K-means is based on variance minimization. The sum-of-variance formula ...READ MORE

answered Jun 21, 2018 in Data Analytics by Sahiti
• 6,370 points
1,657 views
0 votes
1 answer

Overfitting vs Underfitting

In statistics and machine learning, one of ...READ MORE

answered Jul 11, 2018 in Data Analytics by CodingByHeart77
• 3,750 points
1,189 views
+1 vote
1 answer

How to handle Nominal Data?

Nominal data is basically data which can ...READ MORE

answered Jul 24, 2018 in Data Analytics by Abhi
• 3,720 points
653 views
+2 votes
2 answers

How to handle outliers

There are multiple ways to handle outliers ...READ MORE

answered Jul 24, 2018 in Data Analytics by Abhi
• 3,720 points
958 views
0 votes
1 answer

Difference between Regression and classification in Machine Learning?

The goal of regression is to forecast ...READ MORE

answered Mar 4, 2022 in Machine Learning by Dev
• 6,000 points
874 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP