EasyDeepLearn

What's the point of distance-weighted KNN?

easy

Answer

  • Instead of every neighbour voting equally, weight closer neighbours more (e.g., weight = 1/distance or a Gaussian kernel).
  • This makes KNN less sensitive to k, gives a smoother decision boundary near class overlaps, and gives the closest point the strongest vote — useful when the local geometry matters.
  • In scikit-learn, weights='distance'.
Check yourself — multiple choice
  • Weighted KNN uses more neighbours
  • Closer neighbours get more voting weight — smoother decisions, less sensitive to k
  • Weights come from cross-validation
  • It changes the distance metric

Distance-weighted KNN gives closer points more influence and reduces k-sensitivity.

#knn

Practise Supervised Learning

215 interview questions in this topic.

Related questions