Alternating least squares
Alternating least squares is an iterative optimization algorithm that alternately estimates each factor matrix while holding the others fixed.
AI Recommender Systems
Alternating least squares is a matrix-factorization algorithm that iteratively estimates latent factors for users and items by minimizing weighted reconstruction error.
- How it is used
- Serves collaborative filtering as a personalized candidate retriever or a scorer for candidates from other retrieval methods.
- How deep it goes
- Explains alternating closed-form updates and implements library training, but does not derive the least-squares solution.
- Examples
- Uses MovieLens ratings converted to positive interactions, a CSR matrix, and an implicit-library training listing.
- What you can do after
- Apply it via Python’s implicit library to train a recommender and tune its factors, regularization, and iterations on validation data.
Read how AI Recommender Systems explains alternating least squares →
AI-Powered Search
ALS is the alternating least squares algorithm, which estimates factor matrices by iteratively optimizing one factor while holding the other fixed.
- How it is used
- Deploys collaborative filtering to personalize search results from user–item interactions.
- How deep it goes
- Explains alternating optimization and rank, then demonstrates data preparation, Spark training, evaluation, and recommendation indexing.
- Examples
- Uses clicks, carts, purchases, product identifiers, Spark recommendations, and indexed user–product boosts.
- What you can do after
- Apply it via Spark to train recommendation models, evaluate RMSE, and produce personalized search boosts.
Read how AI-Powered Search explains alternating least squares →
What to know first
- collaborative filteringCollaborative filtering is a recommendation technique that infers preferences or associations from interaction patterns among users, items, or other entities.
- user-item interaction matrixA user-item interaction matrix is a matrix whose rows represent users, columns represent items, and entries encode their interactions, preferences, or ratings.
Related concepts
- matrix factorizationkind of · Matrix factorization is the decomposition or approximation of a matrix as a product of simpler, often lower-dimensional or structured matrices.
- baselinecontrasts with · A baseline is a reference model, result, measurement, or level used to compare performance or assess change.
- hyperparameterconfigured by · A hyperparameter is a setting chosen outside ordinary parameter learning that controls a model, algorithm, or learning procedure.
- ordinary least squaresuses · Ordinary least squares is a method for estimating model parameters by minimizing the sum of squared differences between observed values and model predictions.
Questions about alternating least squares
What is alternating least squares?
Alternating least squares is an iterative optimization algorithm that alternately estimates each factor matrix while holding the others fixed.
Which Manning books explain alternating least squares?
AI Recommender Systems and AI-Powered Search.
What should I know before learning alternating least squares?
Manning books that teach alternating least squares usually introduce collaborative filtering and user-item interaction matrix first.
What is the difference between alternating least squares and baseline?
Alternating least squares is an iterative optimization algorithm that alternately estimates each factor matrix while holding the others fixed. A baseline is a reference model, result, measurement, or level used to compare performance or assess change.
What is alternating least squares a kind of?
Alternating least squares is a kind of matrix factorization. Matrix factorization is the decomposition or approximation of a matrix as a product of simpler, often lower-dimensional or structured matrices.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

