KNN regressor algorithm when there are several predictors
kNN would in the case of multiple predictors look at the Euclidian distance between vectors in the predictor space. E.g., if you have three predictors x1, x2, and x3, all data points will be a point in the 3-dimensional space. To measure the distance you simply compute $d=\sqrt{(p_1-x_1)^2+(p_2-x_2)^2+(p_3-x_3)^2}$, and use that to find the neighbors.

You can definitely influence the distance measurements by scaling differently. However, this should probably be done with some care and I would use something like cross-validation to make sure the assumptions work as expected.


Hope this helps!
Can you please help me understanding how KNN regressor works:

How does KNN look for 5 nearest neighbours, when there are several predictors?
Does it look for K nearest neighbours for each predictor separately and then somehow combines the results together? If so, then why wouldn't it be possible for example to look for K1 neighbours on predictor P1, but K2 predictors on predictor P2 etc...Why is it "K" rather than an "array of Ks", where the length of the array equals the number of predictors?

KNN is sensitive to the scale of the predictors, therefore MinMaxScaler is recommended (Python) to be used. Does it mean, that essentially I can leverage this property to my benefit, for example by increasing the scale of certain predictor that I want KNN to give a priority to.


Thank you