I'm performing kNN prediction of numerical variable (knn regression or Locally weighted average). I am using euclidean distance and 1/distance as weights but I don't know how this is applied. and I have question:
How exactly the weightning in WEKA IBk for regression is performed? Is this a simple function like 1/distance or something more complicated? I looked in the source code but I couldn't understand anything. And how exactly the distance is defined - is it euclidean or some modification? What that code means (this is lines 867 and 868 from IBk source code):
distances[i] = distances[i]*distances[i];
distances[i] = Math.sqrt(distances[i]/m_NumAttributesUsed);