Find the SMC and Jaccard similarity coefficient for the foll
Find the SMC and Jaccard similarity coefficient for the following binary vectors: x = (1, 0, 0, 0, 0, 0, 0, 0, 0, 0) y = (0, 0, 0, 0, 0, 0, 1, 0, 0, 1) Consider the term frequency vectors x and y of two documents dx and dy. Find the cosine similarity between the 2. x = (3, 2, 0, 5, 0, 0, 0, 2, 0, 0) y = (1, 0, 0, 0, 0, 0, 0, 1, 0, 2) For the following vectors, x and y, calculate the indicated similarity or distance measures: a) x = (1, 1, 1, 1) y = (2, 2, 2, 2), cosine, correlation, Euclidian b) x = (0, 1, 0, 1) y = (1, 0, 1, 0), cosine, correlation, Euclidan, Jaccard c) x = (1, 1, 0, 1, 0, 1) y = (1, 1, 1, 0, 0, 1) cosine, correlation, Jaccard
Solution
1)))))))))
jacard coefficient=X INTERSECTION Y/ X UNION Y
=7/10=0.7
2))))))))))
COSINE SIMILARITY= X.Y/||X||.||Y||
=3*1+2*1/((3^2+2^2+5^2+2^2))^(1/2)*((1^2+1^2+2^2)^(1/2))
A)cosine=1*2+1*2+1*2/((1^2+1^2+1^2)^(1/2)*((2^2+2^2+2^2)^(1/2))
EUCLIDIAN=((X1-Y1)^2+(X2-Y2)^2 +...+(XN-YN)^2)^(1/2)
euclidian=((2-1)^2+(2-1)^2+(2-1)^2)^(1/2)
b)))))))
cosine=0*1+1*0+0*1+1*0/(1+1)^(1/2)+(1+1)^(1/2)
euclidian=((1-0)^2+(0-1)^2+(1-0)^2+(0-1)^2)^(1/2)
c))))))))))))
COSINE=1*1+1*1+1*1/(1+1+1)^(1/2)(1+1+1)^(1/2)
JACCARD=4/6
