Neighborhood-based collaborative filtering is an intuitive method that generates recommendations by finding users or items with similar rating histories. This approach, often considered memory-based, works directly with the user-item interaction matrix, identifying "neighbors" to predict a user's preference. While such methods can be effective, their performance can degrade as datasets become larger and sparser. For instance, calculating similarities across millions of users or items is computationally intensive. Furthermore, if two items have never been co-rated, their similarity cannot be determined, a common issue in sparse datasets.
To overcome these challenges, we now shift our attention to model-based collaborative filtering. Instead of relying on the entire dataset at prediction time, these methods use the interaction data to train a more compact model that learns the underlying patterns of user taste. This trained model can then make predictions efficiently without needing to scan through all user-item interactions again.
The most prominent family of model-based techniques revolves around discovering latent factors. These are hidden features that help explain the observed ratings. For a movie dataset, these factors might represent genres like "sci-fi" or "comedy," the presence of a certain director, or more abstract attributes like "coming-of-age story" or "high-octane action." The important part is that we do not need to specify these factors beforehand; the model learns them automatically from the patterns in the ratings data.
The core idea is to represent both users and items in a shared, lower-dimensional latent space.
A recommendation is made by comparing a user's vector to an item's vector in this latent space. If the vectors are well-aligned, meaning the user likes the factors that the item possesses, the model predicts a high rating. This prediction is typically calculated as the dot product of the two vectors. This approach allows the model to generalize. It can recommend a sci-fi movie to a user who loves sci-fi, even if that user has never rated a movie from the same director or with the same actors before.
Neighborhood-based methods rely on direct, observable connections (left), whereas latent factor models map users and items to a shared feature space to infer preferences (right).
This brings us to matrix factorization, the primary technique for revealing these latent factors. As outlined in the chapter introduction, matrix factorization decomposes the large, sparse user-item interaction matrix () into two smaller, dense matrices: a user-factor matrix () and an item-factor matrix (). The dot product of a user's vector from and an item's vector from gives us the predicted rating .
By learning these factor matrices, we create a powerful and compact representation of user preferences and item attributes. This model-based approach offers several advantages over its neighborhood-based counterparts:
In the sections that follow, we will explore the mechanics of matrix factorization, starting with one of its most well-known algorithms, Singular Value Decomposition (SVD).
Was this section helpful?
© 2026 ApX Machine LearningAI Ethics & Transparency•