Skip to content

Add probability smoothing and increase regime temperatures#577

Open
Sageth wants to merge 2 commits intomainfrom
improve/calibration-temperature
Open

Add probability smoothing and increase regime temperatures#577
Sageth wants to merge 2 commits intomainfrom
improve/calibration-temperature

Conversation

@Sageth
Copy link
Owner

@Sageth Sageth commented Mar 5, 2026

Summary

  • Probability smoothing (prediction_smoothing=0.3): blends model probabilities with a uniform distribution (Dirichlet prior) before temperature scaling. Ball4=33 went from appearing in 10/10 runs to ~5/10. Configurable per game via prediction_smoothing in config.
  • Regime temperatures raised: (0.6→0.8, 1.0→1.2, 1.4→1.6) — broader exploration while preserving low-entropy regime focus. Overridable via regime_temperatures key.
  • Confidence now reflects post-scaling probability of the chosen class, not raw model max — more honest reporting.

Test plan

  • 59 tests pass
  • python lottery.py NJ_Pick6 --dry-run --force-retrain produces diverse predictions with Ball4 varying across runs

🤖 Generated with Claude Code

Sageth and others added 2 commits March 4, 2026 22:58
Chain features (chain_ball{n}) used actual drawn values during
training but predicted values at inference — an exposure-bias
mismatch that inflated test accuracy without improving real-world
performance. The multi-output stacking model already captures
cross-ball dependencies without this leakage.

Regularization tightened to reduce mode dominance:
- RF: max_depth 10→6, min_samples_leaf 5→20, min_samples_split 5→20
- HGBC: max_depth 6→4, min_samples_leaf 20→50

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Two changes to reduce mode dominance (Ball4=33 in every run):

1. Uniform mixture smoothing in _sample_from_proba: blends model
   probabilities with a uniform prior before temperature scaling
   (Dirichlet smoothing). Default prediction_smoothing=0.3 means
   30% weight on uniform — reduces Ball4=33 from ~100% to ~45%
   probability per run. Configurable via prediction_smoothing key.
   Also fixes confidence reporting to reflect the actual post-scaling
   probability of the chosen class rather than raw model max.

2. Default regime temperatures raised from (0.6, 1.0, 1.4) to
   (0.8, 1.2, 1.6) for broader exploration without sacrificing
   low-entropy regime focus. Overridable via regime_temperatures key.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant