In the previous chapter, we built recommenders by finding similarities between users or items directly from the interaction data. While effective, these neighborhood-based methods do not always capture the subtle patterns underlying user preferences. This chapter introduces model-based collaborative filtering, a different approach that seeks to explain user-item interactions by finding latent factors.
The central technique we will use is matrix factorization. The main idea is to approximate the large, sparse user-item interaction matrix, , by decomposing it into two smaller, dense matrices. One matrix represents users in terms of latent factors (), and the other represents items in terms of the same factors (). We can then estimate any rating in the original matrix with the dot product of the corresponding user and item vectors:
This model helps generalize beyond observed ratings and can provide recommendations for any user-item pair.
Throughout this chapter, you will learn to implement this approach from the ground up. We will start with Singular Value Decomposition (SVD), a foundational matrix factorization algorithm. You will see how to train these models using optimization techniques like Stochastic Gradient Descent (SGD) and how to apply regularization to prevent overfitting. Finally, you will use a popular library to build and generate recommendations with a complete, hands-on example.
4.1 From Neighborhoods to Latent Factor Models
4.2 Introduction to Matrix Factorization
4.3 Singular Value Decomposition (SVD) for Recommendations
4.4 Optimization with Stochastic Gradient Descent (SGD)
4.5 Regularization to Prevent Overfitting
4.6 Using Libraries for Matrix Factorization
4.7 Hands-on Practical: Generating Recommendations with SVD
© 2026 ApX Machine LearningEngineered with