sklearn.metrics.pairwise.paired_cosine_distances

sklearn.metrics.pairwise.paired_cosine_distances(X, Y)[source]

Computes the paired cosine distances between X and Y

Read more in the User Guide.

Parameters
Xarray-like, shape (n_samples, n_features)
Yarray-like, shape (n_samples, n_features)
Returns
distancesndarray, shape (n_samples, )

Notes

The cosine distance is equivalent to the half the squared euclidean distance if each sample is normalized to unit norm