🎁  Cosine Similarity of Item Features

Cosine Similarity of Item Features#

Similarity as the cosine of the angle between two items’ feature vectors.

Important

✨ AI-generated content. This page was written with the assistance of an AI language model and is provided as a learning aid. Despite careful review, it may still contain mistakes, omissions, or out-of-date information. Whether you are new to the topic, a team lead, or a senior practitioner, treat it as a starting point rather than an authoritative reference: read it critically and independently verify anything you act on (code, commands, figures, and factual claims) against official documentation and primary sources before relying on it.

What it is#

Cosine similarity measures how alike two items are by the cosine of the angle between their feature vectors — representations built from metadata (one-hot genres, tags, text) or learned embeddings. It captures orientation, not magnitude, so it is invariant to vector length.

The formula#

\[\cos(\theta) = \frac{\mathbf{A} \cdot \mathbf{B}}{\|\mathbf{A}\|\,\|\mathbf{B}\|},\]

ranging from \(-1\) to \(1\) (0 to 1 for non-negative features) — 1 means identical direction (very similar), 0 means unrelated (orthogonal).

Where it’s used#

It powers content-based filtering and item-item similarity (recommend items close to those a user liked), and it is the usual kernel for computing intra-list similarity / diversity.


Theme: Recommender Systems  ·  All terminology



See also

Source article Adapted (context, re-expressed) in our own words from: Cosine Similarity of Item Features (insightful-data-lab.com).

Tags: purpose: reference topic: terminology level: advanced