Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

cosine similarity python numpy

from scipy import spatial

dataSetI = [3, 45, 7, 2]
dataSetII = [2, 54, 13, 15]
result = 1 - spatial.distance.cosine(dataSetI, dataSetII)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #cosine #similarity #python #numpy
ADD COMMENT
Topic
Name
8+7 =