1,065 views
3 3 votes

I have read online articles involving KNN and its emphasis on normalization. I would like to know if all KNN functions in Python need to involve normalization? 

I do know that normalization computes values that are usually between 0 and 1 but would this process be necessary in all python KNN functions or is it specific to certain scenarios?

When dealing with distance, L1 or L2, would normalization be needed?

 

(a few) Blogs / Articles:

Stack Exchange

Stack OverFlow

Vidyha Analytics

25% Accept Rate Accepted 1 answers out of 4 questions

1 Answer

1 1 vote
Generally, normalization allows features of different natures to be used meaningfully together.  Without it, features would impact the KNN functions proportionately to the magnitude of the numbers that are used to express them.  E.g. GDP per capita would cause unemployment rate to be nearly irrelevant without normalization.

In dealing with distance, all features would share a common "unit" already and are correctly scaled relative to each other, so normalization would not be needed in this instance.

Related questions

3 3 votes
2 2 answers
13.3k
13.3k views
Neo asked Sep 27, 2018
13,330 views
I am wondering what happens as K increases in the KNN algorithm. It seems that as K increases the "p" (new point) tends to move closer to the middle of the decision bound...
1 1 vote
1 1 answer
3.2k
3.2k views
RSH asked Oct 1, 2018
3,239 views
I am not able to figure out how the calculation of the $m$ nearest points will be in a single dimensional array using kNN. Can anyone offer a clue or example?Thank you
1 1 vote
3 3 answers
3.7k
3.7k views
kalyanak.p asked Oct 1, 2018
3,711 views
The KNN function in the sklearn library (when coded properly), outputs the points closest to p based on the value of k, and others.The point(s) would include itself when ...
4 4 votes
1 answers 1 answer
7.6k
7.6k views
tofighi asked Jun 26, 2019
7,617 views
Suppose, you have given the following dataset where x and y are the 2 features and color Red or Blue is the target variable.a) A new data point $x=1$ and $y=1$ is given. ...
3 3 votes
0 0 answers
533
533 views