liveBook · Manning

Latent space

As explained in Machine Learning Platform Engineering

A latent space is a learned lower-dimensional representation space in which entities are positioned according to underlying characteristics inferred by a model.

A latent space is a learned lower-dimensional representation space where users and items are positioned according to characteristics inferred from interaction data. In a matrix-factorization recommender, user and item factors form these representations: their distributions can reveal changing preferences or item popularity, while their proximity can support recommendation explanations. section 11.2.2 section 11.3.2

Use latent representations in a production recommender by:

  • Train a matrix-factorization model on a user-item rating matrix. section 11.2.2
  • Extract user and item embeddings directly from the trained model. section 11.2.2
  • Compare factor distributions across retrained models to detect drift in preferences or item popularity. section 11.2.2
  • Find similar users or items in the space and use neighborhood ratings to explain recommendations. section 11.3.2

Explainable movie recommendations

An explainable matrix-factorization recommender places similar users and items near one another. For one recommendation, an explanation can report that eight of nine similar users rated the movie four or higher, giving the prediction an interpretable neighborhood-based rationale. section 11.3.2

from deepchecks.tabular.checks import FeatureDrift
drift_check_item = FeatureDrift(
    columns=["item_factor_2"]
).run(dataset_item_factors_t1, dataset_item_factors_t2)
drift_check_item.save_as_html()

Run a Deepchecks FeatureDrift check on an item-factor column to compare latent-factor distributions between datasets. section 11.2.2

How Machine Learning Platform Engineering covers it

How deep it goes
Traces representation extraction, neighborhood explanations, and distribution monitoring, without deriving matrix-factorization mathematics.
Examples
Uses MovieLens ratings, user and item embeddings, similar-user neighborhoods, and Deepchecks factor-distribution comparisons.
What it assumes
Builds on user-item rating matrices and recommender models while demonstrating how learned factors support monitoring and explanation.
What you can do after
Apply it via matrix-factorization recommenders and Deepchecks to explain recommendations and monitor latent-factor drift.
How it connects
Connects matrix factorization, embeddings, recommendation systems, explainability, and data drift.

Also explained in

Compare how 18 books explain latent space →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning Platform Engineering. The section links point to the parts of the book it draws on.