Modelli Machine Learning
Overview
BetIntel utilizza un ensemble di modelli ML per generare predizioni calcistiche accurate.
Modelli Disponibili
PRODUCTION_V3_GBM (Raccomandato)
Il modello più avanzato che combina Production V3 con GBM Ensemble.
| Metrica | Valore |
|---|---|
| Accuracy 1X2 | 62-65% |
| Over/Under 2.5 | 64% |
| BTTS | 52% |
| RPS | 0.160 |
| Features | 140+ |
Composizione:
- 55% PRODUCTION_V3 (stabilità)
- 45% GBM Ensemble (precisione)
python
# Pesi combinazione
PRODUCTION_WEIGHT = 0.55
GBM_WEIGHT = 0.45
combined_probs = PRODUCTION_WEIGHT * prod_probs + GBM_WEIGHT * gbm_probsGBM Ensemble
Ensemble di gradient boosting machines:
| Modello | RPS | Peso |
|---|---|---|
| LightGBM | 0.1612 | 50% |
| CatBoost | 0.1609 | 50% |
File:
models/advanced/lightgbm_optimized.pklmodels/advanced/catboost_optimized.pklmodels/advanced/best_params.json(feature columns)
PRODUCTION_V3
Modello base con buona stabilità.
| Metrica | Valore |
|---|---|
| Accuracy 1X2 | 60.1% |
| Over/Under 2.5 | 64.1% |
| BTTS | 52.4% |
| RPS | ~0.18 |
File:
models/ensemble_v3.pkl- 1X2 predictionsmodels/over25_model.pkl- Over/Undermodels/btts_model.pkl- BTTS
Pi-Rating System
Sistema di rating dinamico superiore a ELO per il calcio.
python
class PiRatingSystem:
def __init__(self, initial_rating=0.0, lambda_decay=0.035):
self.lambda_decay = lambda_decay
self.home_ratings = {}
self.away_ratings = {}Basato su: Constantinou & Fenton (2012) - "Determining the level of ability of football teams by dynamic ratings"
Pipeline di Predizione
Match Data
│
▼
┌─────────────────────┐
│ Feature Extractor │ 140+ features
└─────────────────────┘
│
▼
┌─────────────────────┐
│ PRODUCTION_V3 │ Base predictions
└─────────────────────┘
│
▼
┌─────────────────────┐
│ GBM Predictor │ LightGBM + CatBoost
└─────────────────────┘
│
▼
┌─────────────────────┐
│ Combine (55/45) │ Weighted average
└─────────────────────┘
│
▼
┌─────────────────────┐
│ Calibration │ Temperature scaling
└─────────────────────┘
│
▼
Final PredictionMercati Supportati
1X2 (Match Result)
prob_home_win: Probabilità vittoria casaprob_draw: Probabilità pareggioprob_away_win: Probabilità vittoria trasferta
Over/Under 2.5
prob_over_25: Probabilità > 2.5 golprob_under_25: Probabilità ≤ 2.5 gol
BTTS (Both Teams To Score)
prob_btts_yes: Entrambe segnanoprob_btts_no: Almeno una non segna
Double Chance
prob_1x: Casa o pareggioprob_x2: Pareggio o trasfertaprob_12: Casa o trasferta
Asian Handicap
asian_handicap_line: Linea handicap (es. -0.5, -1.0)asian_handicap_home_odds: Quota casaasian_handicap_away_odds: Quota trasferta
Metriche di Valutazione
RPS (Ranked Probability Score)
Misura la calibrazione delle probabilità.
python
def rps(probs, actual):
"""
RPS = 0: predizione perfetta
RPS = 1: predizione peggiore possibile
"""
cum_probs = np.cumsum(probs)
cum_actual = np.cumsum(actual)
return np.mean((cum_probs - cum_actual) ** 2)| Benchmark | RPS |
|---|---|
| Random (33/33/33) | ~0.22 |
| SOTA letteratura | 0.195 |
| BetIntel | 0.160 |
Accuracy
Percentuale di predizioni corrette per il mercato 1X2.
Calibration
Verifica che le probabilità predette corrispondano alle frequenze reali.
Training
Dataset
- 5+ stagioni di dati storici
- 5 leghe top europee (Serie A, Premier League, La Liga, Bundesliga, Ligue 1)
- ~10,000+ partite per training
Cross-Validation
python
from sklearn.model_selection import TimeSeriesSplit
tscv = TimeSeriesSplit(n_splits=5)
for train_idx, val_idx in tscv.split(X):
# Train and evaluateHyperparameter Tuning
python
# LightGBM best params
params = {
'n_estimators': 500,
'max_depth': 6,
'learning_rate': 0.05,
'num_leaves': 31,
'feature_fraction': 0.8,
'bagging_fraction': 0.8,
}Prossimi Sviluppi
- Error Analysis Notebook - Analisi pattern errori
- Probability Calibration - Fix confidence troppo bassa
- League-Specific Models - Modelli per singola lega