8.8. Pairwise metrics, Affinities and Kernels
The sklearn.metrics.pairwise submodule implements utilities to evaluate
pairwise distances or affinity of sets of samples.
This module contains both distance metrics and kernels. A brief summary is given on the two here.
Distance metrics are functions d(a, b) such that d(a, b) < d(a, c)
if objects a and b are considered “more similar” than objects a
and c. Two objects exactly alike would have a distance of zero.
One of the most popular examples is Euclidean distance.
To be a ‘true’ metric, it must obey the following four conditions: