SyntaxFix
Write A Post
Hire A Developer
Questions
You can use cosine_similarity function form sklearn.metrics.pairwise docs
cosine_similarity
sklearn.metrics.pairwise
In [23]: from sklearn.metrics.pairwise import cosine_similarity In [24]: cosine_similarity([[1, 0, -1]], [[-1,-1, 0]]) Out[24]: array([[-0.5]])