Weights cause errors in ranking rare labels and this fixes them
Odds-Shift Slippage in One-vs-Rest Rankers: Diagnosing and Repairing Reweighting-Induced Top-K Errors
Information RetrievalMachine Learning
Summary
When ranking items from many rare categories, giving extra weight to scarce labels can cause big mistakes in the top selections. The authors studied how the expected beneficial effect of these weights often does not fully happen, calling this mismatch odds-shift slippage. They found that a simple mathematical fix helps only partly, but recalibrating predictions per label can restore much of the lost accuracy. Their solution works best when there are enough examples for calibration and avoids harming labels without positives.
What this means in practice
- •For machine learning engineers: Correct imbalanced label weighting to improve top-K recommendation accuracy on rare categories in production ranking models.
- •For data scientists: Calibrate multi-label classification probabilities per label to recover accuracy lost from large reweighting factors.
Authors
Akifumi Goto
Abstract
One-vs-rest rankers that show each user the top-$K$ of many rare labels usually counter imbalance with a per-label positive-class weight, scale_pos_weight $= n_-/n_+$. Elkan's identity says such a weight shifts label $j$'s log-odds by $\ln w_j$, so the model ranks by weighted odds rather than by the marginal that is Bayes-optimal for precision@$K$, and suggests inverting the shift afterwards; what a finite learner does with a weight in the thousands, and which repair then works, has not been measured. We call the gap between the promised and the realized shift odds-shift slippage and measure it on matched pairs of LightGBM and MLP models that differ only in the weights. On Santander the weight takes MAP@7 from 0.808 to 0.117; for the boosted pairs the ideal odds shift accounts for 23% of that loss (32% on Instacart; 98% for an MLP pair on the same rows) and slippage for the rest. We prove that a booster whose leaf steps are capped at $c$ realizes at most $Tηc$ nat of shift in $T$ rounds at rate $η$, which a cap sweep confirms, and show that without a cap saturated cells tie at exactly 1.0, beyond the reach of any separable map. The analytic inversion therefore pays only where the shift was realized and nothing saturated, whereas per-label isotonic regression returns the Santander model to 0.784 (0.780 with the calibrator fitted on the validation period), but only if labels without calibration positives are mapped to their prior rather than passed through. On 11 public MULAN benchmarks and 5 learners the weighted model loses more than half of its MAP@$K$ in 8 of 55 cells, and on delicious and Corel5k the same repair returns it to the unweighted level; per-label calibration hurts where positives are scarce, a harm that a cross-validated rule removes. The recipe is released as oddslip.