Cosine Similarity
  • a type of Similarity Measure that measures the similarity (or angle) between 2 vectors
  • the similarity is scored between an interval [-1, 1]:
    • proportional vectors have a cosine similarity of 1
    • orthogonal vectors have a cosine similarity of 0 (see proof)
    • opposite vectors have a cosine similarity of -1
  • when dealing with positive-only vectors, the similarity is scored between an interval [0, 1]

Cosine Similarity - Formula

  • 𝑐𝑜𝑠(𝜃) = [𝑢̅·𝑣̅] / [||𝑢̅||*||𝑣̅||]

where:

  • 𝑢̅·𝑣̅ - is the dot product
  • ||𝑢̅|| and ||𝑣̅|| - is the magnitude/length of vector

Subpages