Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scipy cosine similarity

from scipy.spatial import distance

distance.cosine([1, 0, 0], [0, 1, 0])
>>> 1.0

distance.cosine([100, 0, 0], [0, 1, 0])
>>> 1.0

distance.cosine([1, 1, 0], [0, 1, 0])
>>> 0.29289321881345254
Comment

PREVIOUS NEXT
Code Example
Python :: Determine the sum of al digits of n 
Python :: django migrate model 
Python :: python turtle triangle 
Python :: numpy array split 
Python :: turn list in to word python 
Python :: python code with sigma 
Python :: python turtle spiral 
Python :: python split string size 
Python :: Python program to implement linear search and take input. 
Python :: python working directory 
Python :: colors in scatter plot python 
Python :: python thread function 
Python :: python constructor overloading 
Python :: django view - APIView (retrieve, update or delete - GET, PUT, DELETE) 
Python :: Python program to draw hexagon 
Python :: hstack 
Python :: python make string one line 
Python :: open file in python directory 
Python :: with open as file python 
Python :: How to append train and Test dataset in python 
Python :: python f string 2 decimals 
Python :: python argparse custom categories 
Python :: gspread_pandas pypi 
Python :: python filter dict 
Python :: shell script to run python 
Python :: cardano 
Python :: import ImageGrab 
Python :: flask login 
Python :: django password field 
Python :: selenium set chrome executable path 
ADD CONTENT
Topic
Content
Source link
Name
1+7 =