Back to AI architectures leaderboard
hobby Color polygraph · architecture detail Deployment-grade

LightGBM (production)

The model the live survey actually uses: the leaderboard's LightGBM + bucket scores at its full configuration (800 trees for gender, 1,000 for age and mood; num_leaves=63; lr=0.03). Training is a two-pass procedure - first an honest evaluation pass on a stratified 6,000 / 710 random split, then a deployment pass that refits the three boosters on all 6,710 valid sessions before emitting them. The Cloudflare worker only handles feature extraction and database persistence; the LightGBM trees themselves ship as JSON and the browser walks them with a 30-line tree walker.

Scores

Gender AUC
0.886
stratified 710-row random hold-out
Age MAE
6.48
R² +0.28 on the hold-out
Mood MAE
8.76
R² +0.24 on the hold-out

Two-pass training

Pass one is the evaluation pass. The 6,710 valid sessions are split with sklearn's train_test_split, stratified on gender with seed 42, into 6,000 train / 710 validation rows. Per-pool bucket grids are built from the 6,000-row training fold only, so there is no leakage on the validation fold. All three heads are fit and scored on the 710-row hold-out; those numbers are what populate the leaderboard row.

Pass two is the deployment pass. The bucket grids are rebuilt from every row, and the three heads are refit on all 6,710 sessions. Only these final boosters get emitted to models-js/ as JSON. The deployed model sees 710 more rows than the eval model did, so its true generalisation should be no worse than what pass one reports - the leaderboard number is a lower bound on what is actually shipping.

An earlier version of this script used a temporal hold-out (the last 710 sessions in submission order) instead of a random stratified split. That cut gender AUC up to 0.900 on the hold-out, but it also blew age and mood MAE up to 7.3 and 10.4 because the newest cohort drifts on those targets - age R² on that hold-out went negative. The random split picked here gives a representative validation distribution and lets all three metrics be evaluated on the same protocol.

Configuration

Project links

Back to AI architectures leaderboard