amanjain110893

Similarity Models

Sep 12th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. Models studied (formulas & behavior):
  2.  
  3. 1. cosine similarity: |v1.v2|/(||v1||*||v2||)
  4.  
  5. 2. euclidean distance: |v1-v2| = ||v1||**2+||v2||**2-2|v1.v2|
  6.  
  7. 3. hamming distance: how many bits are different, but this does not work in our case because here one parameter can give similar behavior in a range of values.
  8.  
  9. 4. boolean model: better for comparing text not numbers
  10. a) this model first takes a set of stemmed corpus of words
  11. b) then for each word in query which belongs it checks in which docs it lies and make set of docs
  12. c) then intersection of those set gives the result
  13.  
  14. 5. extended boolean model: mixture of vector model and boolean model but better for comparing text not numbers
  15.  
  16. a) first find frequency of each word in vector in all documents then multiply it idf(x)/max(idf)
  17.  
  18. v(j)=[w1,j:w2,j....wn,j]
  19. wx,j=f(x,j)*idf(x)/max(idf)
  20.  
  21. b) query is given as booleans (x and y) / (x or y)
  22.  
  23. sim(or,i,j)=sqrt(((w(x,i))^2+(w(y,j))^2/2)
  24. sim(and,i,j)=1-sqrt(((1-w(x,i))^2+(1-w(y,j))^2)/2)
  25.  
  26.  
  27. 6. we can use weighted cosine similarity:
  28. (sum w[i]*u[i]*v[i]) / sqrt[(sum w[i]*u[i]^2)*(sum w[i]*v[i]^2)]
  29. but we don't know what weight to be given to individual parameter.
  30.  
  31. 7. weighted euclidean distance: if elements are varying more than the threshold value then it has to be given higher weight so that sum of difference increases which is obvious.
Advertisement
Add Comment
Please, Sign In to add comment