This documentation is for scikit-learn version 0.10Other versions

Citing

If you use the software, please consider citing scikit-learn.

This page

8.16.4.6. sklearn.metrics.pairwise.distance_metrics

sklearn.metrics.pairwise.distance_metrics()

Valid metrics for pairwise_distances

This function simply returns the valid pairwise distance metrics. It exists, however, to allow for a verbose description of the mapping for each of the valid strings.

The valid distance metrics, and the function they map to, are:

metric Function
‘cityblock’ sklearn.pairwise.manhattan_distances
‘euclidean’ sklearn.pairwise.euclidean_distances
‘l1’ sklearn.pairwise.manhattan_distances
‘l2’ sklearn.pairwise.euclidean_distances
‘manhattan’ sklearn.pairwise.manhattan_distances