slickbet.model¶

Betting model for calculating win/loss probabilities.

Implements a weighted scoring system over form, league position, home advantage, H2H, bookmaker odds, goals, venue form, defense, momentum, match statistics, expected goals (xG), and discipline/reliability. Produces BetPrediction objects including draw risk and double-chance probabilities.

Classes¶

BetOutcome

Possible betting outcomes.

BetPrediction

Represents a betting prediction for a match.

BettingModel

Model for calculating betting probabilities based on match statistics.

DoubleChancePrediction

Represents double chance betting predictions for a match.

Module Contents¶

class slickbet.model.BetOutcome[source]¶

Bases: enum.Enum

Possible betting outcomes.

AWAY_OR_DRAW = 'away_or_draw'¶
AWAY_WIN = 'away_win'¶
DRAW = 'draw'¶
HOME_OR_AWAY = 'home_or_away'¶
HOME_OR_DRAW = 'home_or_draw'¶
HOME_WIN = 'home_win'¶
class slickbet.model.BetPrediction[source]¶

Represents a betting prediction for a match.

confidence: float¶
defense_score: float = 0.0¶
double_chance: DoubleChancePrediction | None = None¶
draw_risk: float = 0.0¶
property expected_value: float¶

Calculate expected value assuming fair 2.0 odds.

EV = (probability * potential_win) - (1 - probability) * stake

Returns:

float – Expected value per unit stake at even money.

form_score: float¶
goal_score: float = 0.0¶
h2h_score: float¶
home_advantage_score: float¶
match: slickbet.api.Match¶
match_stats_score: float = 0.0¶
property match_stats_used: bool¶

Check if match statistics were used in this prediction.

Returns:

bool – True if match statistics contributed to the prediction

momentum_score: float = 0.0¶
odds_score: float = 0.0¶
position_score: float¶
probability: float¶
reasoning: list[str] = None¶
recommended_outcome: BetOutcome¶
reliability_score: float = 0.0¶
venue_form_score: float = 0.0¶
xg_score: float = 0.0¶
class slickbet.model.BettingModel(form_weight: float | None = None, position_weight: float | None = None, home_weight: float | None = None, h2h_weight: float | None = None, odds_weight: float | None = None, goals_weight: float | None = None, venue_form_weight: float | None = None, defense_weight: float | None = None, momentum_weight: float | None = None, match_stats_weight: float | None = None, xg_weight: float | None = None, reliability_weight: float | None = None, min_confidence: float = 0.55)[source]¶

Model for calculating betting probabilities based on match statistics.

The model uses a weighted scoring system combining multiple factors.

ENHANCED VERSION with 12 factors: - Core: Form, Position, Home Advantage, H2H, Odds - Goals: Attack/defense strength, Venue Form, Defense (clean sheets) - Momentum: First-half performance and consistency - Match Stats: Historical averages (possession, attacks, shots on target) - xG: Expected Goals differential (quality of chances created) - Reliability: Team discipline based on card counts (fewer cards = more reliable)

Weights optimized based on 120-day backtest across 5 major leagues (704 matches): - Bundesliga: 81.3% accuracy (excl. draws) - Premier League: 78.2% accuracy (excl. draws) - Serie A: 74.8% accuracy (excl. draws) - Ligue 1: 70.9% accuracy (excl. draws) - La Liga: 68.9% accuracy (excl. draws)

DRAW_RISK_THRESHOLD = 0.15¶
HOME_ADVANTAGE = 0.12¶
MIN_CONFIDENCE = 0.55¶
WEIGHTS¶
filter_confident_predictions(predictions: list[BetPrediction], min_confidence: float | None = None) list[BetPrediction][source]¶

Filter predictions by minimum confidence threshold.

Parameters:
  • predictions (list[BetPrediction]) – List of predictions to filter

  • min_confidence (float or None, optional) – Minimum confidence (defaults to model’s threshold)

Returns:

list[BetPrediction] – Filtered list of predictions

min_confidence = 0.55¶
predict(match: slickbet.api.Match) BetPrediction[source]¶

Generate a betting prediction for a match.

Parameters:

match (Match) – Match object with statistics

Returns:

BetPrediction – BetPrediction with probabilities and recommendation

weights¶
class slickbet.model.DoubleChancePrediction[source]¶

Represents double chance betting predictions for a match. Double chance allows betting on two outcomes at once (safer but lower odds).

away_or_draw_prob: float = 0.0¶
property best_double_chance: tuple[str, float]¶

Return the best double chance bet and its probability.

Returns:

tuple[str, float] – (label, probability) for the highest double-chance option.

home_or_draw_prob: float = 0.0¶
no_draw_prob: float = 0.0¶