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

‘haversine’

metrics.pairwise.haversine_distances

‘l1’

metrics.pairwise.manhattan_distances

‘l2’

metrics.pairwise.euclidean_distances

‘manhattan’

metrics.pairwise.manhattan_distances

‘nan_euclidean’

metrics.pairwise.nan_euclidean_distances

Read more in the User Guide.

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