Files
iddaai-be/ai-engine/reports/diagnostic_backtest_20260525_024437.json
T
fahricansecer 988ee2f50d Add backtest pipeline, betting_brain filters, score coherence + social v3
betting_brain.py:
- HARD_MIN_SAMPLES=50 floor for calibrator bypass
- ev_edge < 0 + >= 0.20 hard vetoes
- BTTS muted (grid search found no profitable config)
- Per-market optimal envelopes (MS, OU25)
- Score coherence filter: main_pick must agree with score prediction
- HTFT reversal cross-check for MS picks

feature_builder.py / data_loader.py:
- Real home/away_position from data (was hardcoded 10)
- Cup detection wired into UpsetEngine
- _estimate_league_position with 300-day season filter

New scripts:
- diagnostic_backtest.py: per-bet diagnostic backtest with loss patterns
- optimize_filters.py: grid search per-market optimal thresholds
- analyze_backtest_csv.py: root-cause hypothesis testing on CSV
- compare_backtests.py: side-by-side validation with verdict
- test_score_coherence.py: smoke test for coherence filter (20/20 pass)

Reports:
- diagnostic_backtest_20260525_024437 (50-match smoke)
- diagnostic_backtest_20260525_035649 (1000-match in-sample)
- filter_optimization_patch.json (grid search winners per market)

Social poster v3:
- satori + resvg HTML/CSS rendering pipeline
- Twemoji football/basketball + flag SVGs
- caption SEO: 12 curated hashtags per post
- image SEO: descriptive filenames + .json metadata sidecar
- /health, /preview-png, /run-now endpoints

Docs:
- mds/SESSION_HANDOFF.md: full session state for cross-machine continuity
- mds/SOCIAL_POSTER_SETUP.md: API keys + test commands

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 20:43:28 +03:00

220 lines
4.2 KiB
JSON

{
"args": {
"days": 3,
"max_matches": 50,
"start": null,
"end": null,
"progress_interval": 50
},
"aggregate": {
"overall": {
"n_total": 50,
"n_playable_settled": 27,
"wins": 15,
"losses": 12,
"hit_rate_pct": 55.56,
"unit_profit": -0.862,
"staked": 5.4,
"roi_pct": -15.96
},
"by_market": {
"OU25": {
"n_total": 13,
"n_playable_settled": 13,
"wins": 7,
"losses": 6,
"hit_rate_pct": 53.85,
"unit_profit": -0.6,
"staked": 2.6,
"roi_pct": -23.08
},
"BTTS": {
"n_total": 12,
"n_playable_settled": 12,
"wins": 6,
"losses": 6,
"hit_rate_pct": 50.0,
"unit_profit": -0.392,
"staked": 2.4,
"roi_pct": -16.33
},
"MS": {
"n_total": 2,
"n_playable_settled": 2,
"wins": 2,
"losses": 0,
"hit_rate_pct": 100.0,
"unit_profit": 0.13,
"staked": 0.4,
"roi_pct": 32.5
}
},
"by_confidence": {
"65-70": {
"n_total": 22,
"n_playable_settled": 22,
"wins": 13,
"losses": 9,
"hit_rate_pct": 59.09,
"unit_profit": -0.472,
"staked": 4.4,
"roi_pct": -10.73
},
"55-60": {
"n_total": 4,
"n_playable_settled": 4,
"wins": 2,
"losses": 2,
"hit_rate_pct": 50.0,
"unit_profit": -0.19,
"staked": 0.8,
"roi_pct": -23.75
},
"60-65": {
"n_total": 1,
"n_playable_settled": 1,
"wins": 0,
"losses": 1,
"hit_rate_pct": 0.0,
"unit_profit": -0.2,
"staked": 0.2,
"roi_pct": -100.0
}
},
"by_odds": {
"1.3-1.5": {
"n_total": 11,
"n_playable_settled": 11,
"wins": 9,
"losses": 2,
"hit_rate_pct": 81.82,
"unit_profit": 0.28,
"staked": 2.2,
"roi_pct": 12.73
},
"1.5-1.8": {
"n_total": 10,
"n_playable_settled": 10,
"wins": 5,
"losses": 5,
"hit_rate_pct": 50.0,
"unit_profit": -0.352,
"staked": 2.0,
"roi_pct": -17.6
},
"1.8-2.2": {
"n_total": 6,
"n_playable_settled": 6,
"wins": 1,
"losses": 5,
"hit_rate_pct": 16.67,
"unit_profit": -0.79,
"staked": 1.2,
"roi_pct": -65.83
}
},
"by_grade": {
"B": {
"n_total": 27,
"n_playable_settled": 27,
"wins": 15,
"losses": 12,
"hit_rate_pct": 55.56,
"unit_profit": -0.862,
"staked": 5.4,
"roi_pct": -15.96
}
},
"by_competition": {
"league": {
"n_total": 27,
"n_playable_settled": 27,
"wins": 15,
"losses": 12,
"hit_rate_pct": 55.56,
"unit_profit": -0.862,
"staked": 5.4,
"roi_pct": -15.96
}
}
},
"loss_diagnostics": {
"n_losses": 12,
"total_loss_units": -2.4,
"patterns": {
"high_htft_reversal_prob (>=0.20)": [
0,
0.0
],
"cup_match": [
0,
0.0
],
"low_league_reliability (<0.45)": [
0,
0.0
],
"v27_disagree": [
3,
25.0
],
"trap_market_flagged": [
4,
33.33
],
"low_calibrated_conf (<55)": [
0,
0.0
],
"high_odds_underdog (>=2.5)": [
0,
0.0
],
"low_data_quality (<0.55)": [
0,
0.0
],
"high_risk_level": [
3,
25.0
],
"inferred_features": [
12,
100.0
]
},
"by_market": [
[
"BTTS",
6
],
[
"OU25",
6
]
],
"by_league": [
[
null,
12
]
],
"top_bb_issues_in_losses": [
[
"inferred_statistical_features",
12
],
[
"triple_value_not_confirmed",
12
],
[
"trap_market_market_overpriced",
4
]
],
"top_bb_vetoes_in_losses": []
},
"recommendations": [],
"errors_sample": []
}