Recommendation systems · Notebook course map
Learn through code. Open a chapter, predict what will happen, run one cell at a time, change one variable, and inspect the result.
| Notebook | Evidence and scope |
|---|---|
| 01 · Real data and ItemCF | Real data |
| 02 · Two towers, tensors, and gradients | Real data and the shared trainer |
| Foundations, metrics, and A/B testing | Real data + simulated assignment |
| Retrieval, samples, and indexes | Real snapshots + mechanism exercises |
| Multiple objectives, MMoE, and pre-ranking | Controlled simulation, not impression CTR |
| FM, DCN, LHUC, and FiBiNET | Tensor and gradient mechanisms |
| LastN, DIN, and SIM | Real histories + teaching attention variants |
| Diversity, rules, and DPP | Real vectors + numerical checks |
| Cold start and traffic allocation | Real attributes + simulated traffic |
| System improvement and engineering experiments | Real snapshots + controlled drift/social simulation |
English companion. All instructional Markdown is translated. Experiment code, Chinese language examples, execution counts, and saved outputs remain as in the source edition; historical output text may therefore be Chinese. The initial setup cell anchors the working directory and Python import path for this companion's deeper folder; it does not change the experiment. Saved outputs are historical evidence, not a new run. Run from the top after preparing the required data and models.
# English companions live one directory deeper; keep the original experiment code unchanged.
from pathlib import Path as _TranslationPath
import os as _translation_os
import sys as _translation_sys
_translation_root = next((p for p in [_TranslationPath.cwd(), *_TranslationPath.cwd().parents]
if (p / "reclab").is_dir()), None)
if _translation_root is None:
raise RuntimeError("Open this notebook from inside the Search Recommendation Ads Lab checkout.")
_translation_os.chdir(_translation_root)
if str(_translation_root) not in _translation_sys.path:
_translation_sys.path.insert(0, str(_translation_root))
How to learn
- Start with 01 and 02 to build intuition for data, tensors, autograd, and training.
- Chapters 03–10 accompany all 45 lecture decks. Topic coverage does not mean full reproduction of 45 papers.
- Each section distinguishes real data, constructed tensors, and simulated traffic.
- Use Shift+Enter. The final cell in 02 saves a new model; the other topic chapters default to in-memory experiments.
- Code lives in
reclab/andreclab/learning/; consult the slides for reference.
from pathlib import Path
import sys
print('Python:',sys.executable)
print('Current directory:',Path.cwd())Saved notebook output · not executed on this page
Python: /Users/lynnlee/Documents/Codex/2026-10-30/task/soutui-lab/.venv/bin/python Current directory: /Users/lynnlee/Documents/Codex/2026-10-30/task/soutui-lab/notebooks
Your experiment log
Write three lines each time: What I predicted → the one thing I changed → what the result supports and what it still cannot establish.
Run each notebook from the beginning on the first pass. After that, change one parameter and rerun the relevant cell and all downstream cells.
Real competition reproduction
WSDM Cup 2022 XMRec: the full official dataset and the core methods of the OPDAI winning solution. Results are stored separately from the original Retailrocket experiments.
Start with 11 Task and data, followed by 12 Features, 13 Sampling and graph models, 14 Retraining and ablation, and 15 Evaluation.
This reproduces core algorithms with a local training recipe, not the complete winning ensemble or its hidden-test score.