Important Questions Related To Module-1 & Module-2
Important Questions Related To Module-1 & Module-2
23. For the following asymmetric binary attributes, calculate the Jaccard
coefficient (similarity) between following two objects:
X = (1, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Y= (0, 0, 0, 0, 0, 0, 1, 0, 0, 1)
24. Calculate cosine similarity for the following two document vectors:
X = (3, 2, 0, 5, 0, 0, 0, 2, 0, 0)
Y = (1, 0, 0, 0, 0, 0, 0, 1, 0, 2)
Solve : Q-11
Explanation:
Given,
P = (22, 1, 42, 10)
Q = (20, 0, 36, 8)
a. Formula for Euclidean Distance :
distance = ((p1-q1)^2 + (p2-q2)^2 + ... + (pn-qn)^2)^(1/2)
Now,
distance = ( (22-20)^2 + (1-0)^2 + (42 - 36)^2 + (10-8)^2) ) ^(1/2)
=( (2)^2 + (1)^2 + (6)^2 + (2)^2 ) ) ^(1/2)
=(4+1+36+4)^(1/2)
=45^(1/2)
Distance = 6.7082
b.Manhattan distance :
d = |x1 - x2| + |y1 - y2|
d = |22- 20| + |1 - 0|
d = |2| + |1|