>>> from sklearn.metrics.pairwise import cosine_similarity
>>> from sklearn.metrics.pairwise import pairwise_distances
>>> a=[[1,3],[2,2]]
>>> cosine_similarity(a)
array([[ 1. , 0.89442719],
[ 0.89442719, 1. ]])
>>> pairwise_distances(a,metric="cosine")
array([[ 0. , 0.10557281],
[ 0.10557281, 0. ]])
>>>
Cosine distance 等于 1.0 减 cosine similarity.