Created on Oct 2, 2012
@author: georgianadinu
Bases: composes.similarity.similarity.Similarity
Computes the cosine similarity of two vectors.
\(sim(\vec{u},\vec{v}) = \frac{<\vec{u},\vec{v}>}{\sqrt{||\vec{u}||||\vec{v}||}}\)
Created on Oct 2, 2012
@author: georgianadinu
Bases: composes.similarity.similarity.Similarity
Computes the scalar product (dot product) of two vectors.
\(sim(\vec{u},\vec{v}) = <\vec{u},\vec{v}> = \sum_iu_iv_i\)
Created on Oct 2, 2012
@author: georgianadinu
Bases: composes.similarity.similarity.Similarity
Computes the euclidean similarity of two vectors as the inverse of their euclidean distance.
\(sim(\vec{u},\vec{v}) = \frac{1}{||\vec{u}-\vec{v}|| + 1}\)
Created on Oct 2, 2012
@author: georgianadinu
Bases: composes.similarity.similarity.Similarity
Computes the Lin similarity of two vectors.
\(sim(\vec{u},\vec{v}) = \frac{\sum_{i \in I}(u_i+v_i)}{\sum_iu_i + \sum_iv_i}\)
Where \(I=\{i | u_i > 0 \text{ and } v_i > 0\}\), the set of components on which both vectors are strictly positive.