Dropping ranking metrics in a recommender system, part 3: an experiment platform

Daria Tikhonovich, Grigoriy Gusarov25 Aug 2023

Problem

A recommender team cannot know in advance which metric to maximize or what a good solution looks like. It has to try many approaches, compare recommendations by eye, and sometimes return to old models. Without infrastructure, even "why did we reject that model" takes too long to answer. The authors report that 90% of their project time went to pipelines and infrastructure rather than to models.

Example from the article: a two-person pet project on the Kion online-cinema dataset needed to compare collaborative filtering, heuristics and a two-stage CatBoost model with the same validation and publish the winners in a live app.

Solution in brief

Experiments are driven by a few YAML configs and one command. DVC rebuilds only the data stages whose inputs changed, RecTools gives all algorithms one fit/recommend API, and a wrapper class gives the two-stage model the same API. Models are validated by rolling-window cross-validation, logged in MLflow and served from its registry.

Questions this case answers
  • How to build a reproducible, config-driven experiment workflow for models whose algorithms live in different libraries and whose quality cannot be judged by one offline metric
  • How to validate a multi-stage ranking model on rolling time windows when time-dependent features must be recomputed for every stage and fold
  • How to run reproducible recommender experiments with one command and compare many algorithms on the same data?
  • How to plug different recommendation libraries and a two-stage model into one config-driven workflow?

Tools and methods

  • DVC — pipeline DAG for data and features; reruns only stages whose dependencies changed
  • RecTools — one API (init, fit, recommend), metrics and cross-validation for ItemKNN, ALS, SVD, LightFM, heuristics
  • MLflow — experiment tracking and Model Registry feeding the online service
  • CatBoost — second-stage ranker of the two-stage model
  • FastAPI, Streamlit, Nginx, Docker, MinIO — serving, frontend, routing, containers, artifacts
Continue reading — it's free

Google or a one-time email code. No password.