Skip to content

Applied ML and Data Science · Feb – Mar 2026

E-Commerce Product Classifier

Macro F1 0.641 across 19 imbalanced categories, at ~42ms

Source

The problem

Classifiers degrade silently when incoming product data drifts away from the training distribution.

Approach

Fine-tuned DistilBERT across 19 product categories with FastAPI serving. Real-time drift detection via Evidently AI alerts when incoming data diverges from the training distribution, catching silent accuracy degradation before it reaches production. React analytics dashboard, fully containerised.

How it works

Key decisions

Put drift detection on the serving path
A classifier that degrades silently is worse than one that fails loudly, because nobody investigates a number that is merely drifting. Checking distribution on the way in makes decay visible while it is still cheap to fix.
Report the macro F1, not the best category
Macro F1 of 0.641 across 19 imbalanced categories is the honest aggregate. Digital Music reaches 97.2% and the semantically overlapping categories drag it down, so the per-category breakdown is published rather than the headline figure alone.

What the measurements showed

Running it

docker compose up

Full setup, configuration and API reference are in the repository README.

Stack

Written up in