W3cubDocs

/scikit-learn

sklearn.metrics.pairwise.distance_metrics

sklearn.metrics.pairwise.distance_metrics() [source]

Valid metrics for pairwise_distances.

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

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

metric Function
‘cityblock’ metrics.pairwise.manhattan_distances
‘cosine’ metrics.pairwise.cosine_distances
‘euclidean’ metrics.pairwise.euclidean_distances
‘l1’ metrics.pairwise.manhattan_distances
‘l2’ metrics.pairwise.euclidean_distances
‘manhattan’ metrics.pairwise.manhattan_distances

Read more in the User Guide.

© 2007–2018 The scikit-learn developers
Licensed under the 3-clause BSD License.
http://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise.distance_metrics.html