Skip to content

Weighted KNN

A variant of the K-nearest-neighbors method in which neighbors are counted with different weights: the closer an object, the larger its contribution.

Why

In ordinary KNN all \(K\) neighbors are equal: an object at distance 0.1 and an object at distance 4.9 cast the same vote. As a result, a distant and noisy neighbor can outweigh a close and accurate one.

Typical Weight

Inversely proportional to the distance:

\[ w_i=\frac{1}{d_i+\varepsilon} \]

As \(d\to 0\) the weight grows, so close objects decide the outcome.

See Also

← All Terms