When using KNeighborsClassifier
, what is the motivation of using weights="distance"
?
According to the scikit-learn documentation:
‘distance’ : weight points by the inverse of their distance. In this case, closer neighbors of a query point will have a greater influence than neighbors which are further away.
What is the motivation for using this?