Blogs · Recommender Systems · Machine Learning

Recommender Systems I: Content-Based and Collaborative Filtering

A practical introduction to content-based recommendation, collaborative filtering, user-item matrices, similarity, cold start, and evaluation.

2020.04.01 · 2 min read · by Zhenlin Wang

Introduction

Recommender systems help users discover items: movies, products, songs, posts, jobs, restaurants, or documents.

Two classic families are:

Modern systems often combine both, but the distinction is still useful.

Content-Based Recommendation

Content-based systems recommend items similar to what a user already liked.

They rely on item features:

The system builds a user profile from previously liked or consumed items, then recommends items with similar features.

Pros

Cons

Collaborative Filtering

Collaborative filtering uses behavior patterns across users and items.

The core idea:

Users who behaved similarly in the past may like similar items in the future.

The data is often represented as a user-item matrix:

rows: users
columns: items
values: ratings, clicks, purchases, watch time, or implicit feedback

User-Based Collaborative Filtering

Find users similar to the target user, then recommend items those similar users liked.

Item-Based Collaborative Filtering

Find items similar to items the user liked, then recommend those items.

Item-based methods are often more stable because item similarities can change more slowly than user preferences.

Similarity

Common similarity measures:

The right measure depends on whether feedback is explicit ratings, implicit actions, binary events, or dense embeddings.

Cold Start

Cold start happens when the system lacks history.

New users:

New items:

Hybrid systems often exist because pure collaborative filtering struggles with cold start.

Evaluation

Offline metrics:

Online metrics:

A recommender can improve clicks while hurting long-term trust. Always use guardrail metrics.

Closing

Content-based methods use item meaning. Collaborative filtering uses collective behavior. Strong recommender systems usually combine both and evaluate beyond a single ranking metric.