0
6.6kviews
Find the jaccard distance and cosine distance between the following pairs of set: X=(0,1,2,4,5,3) and Y=(5,6,7,9,10,8)
1 Answer
written 5.6 years ago by | • modified 5.6 years ago |
Data:
X = (0, 1, 2, 4, 5, 3) Y = (5, 6, 7, 9, 10, 8)
Jaccard Distance:
$JD(x,y) = 1 - \frac{ |x \wedge y |}{|x u y|}$
$ = 1 - \frac{1}{12}$
Jacard Distance = 11/12
Cosine distance:
Cosine $ (x, y) = \frac{ x . y}{ || \times || . || \times ||}$
x . y = 0 x 5 + 1 x 6 + 2 x 7 + 4 x 9 + 5 x 10 + 3 x 8
= 0 + 6 + 14 + 36 + 50 + 24
= 130
$11 \times 11 = \sqrt{0^2 + 1^2 + 2^2 + 4^2 + 5^2 + 3^2}$
$= \sqrt{0 + 1+ 4 + 16 + 25 + 9}$
$= \sqrt{55}$
$11 y 11 = \sqrt{5^2 + 6^2 + 7^2 + 9^2 + 10^2 + 8^2}$
$= \sqrt{355}$
Cosine Distance = $5 \sqrt{781}$