The H&M dataset and the FTI split

The dataset is the H&M Personalized Fashion Recommendations competition. Three tables: articles describes the catalogue, customers describes the audience, transactions records who bought what when. The sampled slice we ship in the repo is the same shape as the full dataset, just smaller so it trains in under five minutes on a laptop.

Feature, Training, Inference (FTI)

A production-ready ML system separates feature engineering, model training, and online serving. Each can be developed, deployed, and scaled independently.

notebooks/01_explore_dataset.ipynb
python
import polars as pl
from pathlib import Path

DATA = Path('data/sample')
articles = pl.read_parquet(DATA / 'articles_sample.parquet')
customers = pl.read_parquet(DATA / 'customers_sample.parquet')
transactions = pl.read_parquet(DATA / 'transactions_sample.parquet')

print('articles:', articles.shape)
print('customers:', customers.shape)
print('transactions:', transactions.shape)

Load the three sampled parquet files. The shapes are typical of retail data.

The FTI split exists for a reason. Feature engineering happens on batches and writes to a store you can read at inference time. Training reads features through that same store. Serving reads features for a single customer in milliseconds. Coupling them means a change in one breaks the others. Splitting them means you can iterate on ranking without touching the feature pipeline.

Quiz: Quiz

Loading practice…

Flashcards: Flashcards

Loading practice…