Distance Weights Flip the Vote
A query point's five nearest neighbors, in order:
| neighbor | distance | class |
|---|---|---|
| 1 | 1.0 | A |
| 2 | 3.0 | B |
| 3 | 4.0 | B |
| 4 | 5.0 | B |
| 5 | 10.0 | B |
KNeighborsClassifier(n_neighbors=5) defaults to weights='uniform'; weights='distance' weights each neighbor by . What does each setting predict?
Sign in to answer questions and track your progress
Sign In