Course contentsShow
← Machine Learning and Deep Learning
Lesson 2340 of 3,53851. Recommender SystemsFree lesson

Item Feature Representation

Representing items as feature vectors using attributes like tags, categories, descriptions, and metadata.

Item Feature Representation

What you'll learn: How to encode items as numerical feature vectors that capture their attributes for use in recommender systems.

The Core Idea

In content-based filtering, we can't just feed raw items (movies, products, articles) into our models. We need to translate each item into a feature vector—a list of numbers that mathematically represents what that item is. Think of it like creating a standardized "profile card" for every item, where each field is a number our model can process.

From Attributes to Vectors

Items come with various types of information:

  • Tags and categories: "action", "sci-fi", "comedy"
  • Text descriptions: movie plots, product reviews
  • Metadata: release year, price range, brand
  • Multi-valued attributes: actors, directors, ingredients

The challenge is converting these diverse attributes into a consistent numerical format.

Representation Strategies

One-hot encoding works for categorical features: if a movie's genre is "sci-fi" from three possible genres, represent it as [0, 1, 0].

TF-IDF vectors capture textual descriptions, turning words into weighted importance scores.

Embeddings can map high-dimensional sparse features (like thousands of possible tags) into dense, lower-dimensional vectors that capture semantic similarity.

Concatenation combines different feature types: stack genre vectors, year (normalized), and average rating into one comprehensive vector like [0, 1, 0, 0.75, 4.2].

Why This Matters

Once items are vectors, you can compute similarity (via cosine distance or dot products) and feed them into neural networks. A user who liked items with vector [0.8, 0.2, 0.5] might enjoy items close to that pattern in vector space.

Key Takeaway: Item feature representation transforms heterogeneous item attributes into standardized numerical vectors, enabling mathematical comparison and learning in content-based recommender systems.