chapter two

2 Implementing a simple recommender model

 

This chapter covers

  • The importance of starting with a simple solution
  • Non-personalized recommendations
  • Creating a simple item-to-item recommender.
  • How an item-to-item recommender can be used for user-based recommendations.
  • Looking at recommender systems as decision problems.

In Chapter 1, we explored what modern recommender systems are and their role in today's AI landscape. Now, we'll get hands-on and build our first working systems. But before diving into neural networks or large language models, we'll start with something simpler—and more important than most people realize.

This chapter focuses on getting a few different simple recommender models up and running. That way, we have something to compare against and use as a reference point for evaluation throughout the rest of the book.

We start with non-personalized recommendations based on popularity and descriptive statistics. Then we move to more personalized approaches using a user-item matrix. If you remember matrices from linear algebra, this will look familiar—but don't worry, we'll keep the math straightforward. To make personalized predictions, we need a concept of a user or session to understand what content is consumed together. With session data, we can build item-to-item recommenders that extend naturally to user-to-item systems.

2.1 Start with the simplest recommender system

2.1.1 Popularity: The Fallback Recommender

2.2 Building a Collaborative Filtering Recommender

2.2.1 The Data: User-Item Interactions

2.2.2 Stage 1: Retrieval - Finding Similar Items

2.2.3 Stage 2: Filtering - Removing Consumed Items

2.2.4 Stage 3: Scoring - Adding Multiple Signals

2.2.5 Stage 4: Ranking - Combining Multiple Scores

2.2.6 The four-stage recommender in action

2.2.7 "Popular for You" - Personalized Popularity

2.2.8 Creating the Framework

2.2.9 The Cold Start Problem

2.3 Content-Based Recommendations

2.3.1 Using Item Metadata

2.3.2 Fitting Into the Four-Stage Framework

2.3.3 Combining Behavioral and Content Signals

2.4 Wrapping up

2.5 Further Reading

2.6 Summary