footix package

Subpackages

Module contents

Footix: Football analytics and prediction framework.

A comprehensive library for football match prediction, odds analysis, and betting strategy optimization using statistical models and machine learning.

Main exports:
  • Bet: Represents a single betting opportunity

  • OddsInput: Input odds format for analysis

  • EdgeFloorConfig: Configuration for edge detection

  • OddsRange: Range of odds for filtering

  • ProbaResult: Probability prediction results

  • SampleProbaResult: Sampled probability results

class footix.EdgeFloorConfig(ranges: Sequence[footix.strategy.select_bets.OddsRange] = <factory>, default_edge_floor: float = 0.0, default_prob_edge: float | None = None)[source]

Bases: object

Parameters:
ranges: Sequence[OddsRange]
default_edge_floor: float
default_prob_edge: float | None
get_thresholds(odds)[source]

Return edge-floor thresholds for the given odds.

Parameters:

odds (float)

Return type:

Thresholds

class footix.OddsRange(min_odds, max_odds, edge, prob_edge=None)[source]

Bases: NamedTuple

Represents an odds range and its corresponding edge and probability thresholds.

Parameters:
min_odds

Minimum odds value (inclusive)

Type:

float

max_odds

Maximum odds value (inclusive)

Type:

float

edge

Required edge floor for this odds range

Type:

float

prob_edge

Required probability of positive edge (optional)

Type:

float | None

min_odds: float

Alias for field number 0

max_odds: float

Alias for field number 1

edge: float

Alias for field number 2

prob_edge: float | None

Alias for field number 3

class footix.Bet(match_id, market, odds, prob_mean, edge_std=None, prob_edge_pos=None, stake=0.0)[source]

Bases: object

Represents a single betting opportunity with associated edge information.

Parameters:
match_id

Identifier for the match.

Type:

str

market

Market selection — ‘H’ for home, ‘D’ for draw, ‘A’ for away.

Type:

str

odds

Decimal odds offered by the bookmaker.

Type:

float

edge_mean

Estimated edge over the bookmaker. Computed as (p*(odds-1) - (1-p))

Type:

float

prob_mean

Estimated probability of the event occurring based on the model.

Type:

float

edge_std

Standard deviation of the edge estimate.

Type:

Optional[float]

prob_edge_pos

Probability that the edge is positive (i.e., a value bet).

Type:

Optional[float]

stake

The stake of the bet. By default stake = 0.

Type:

float

match_id: str
market: str
odds: float
prob_mean: float
edge_std: float | None = None
prob_edge_pos: float | None = None
stake: float = 0.0
edge_mean: float
to_dict()[source]
Return type:

dict

classmethod combine_many(bets)[source]

Combines multiple independent bets into a single combined bet (accumulator).

Parameters:

bets (list[Bet]) – List of Bet instances to combine.

Returns:

A new Bet representing the combined bet.

Return type:

Bet

class footix.OddsInput(home_team, away_team, odds)[source]

Bases: object

Represents the input odds for a match.

Parameters:
home_team

Name of the home team.

Type:

str

away_team

Name of the away team.

Type:

str

odds

Decimal odds in the format [H, D, A], where: - H: Odds for the home team to win. - D: Odds for a draw. - A: Odds for the away team to win.

Type:

list[float]

home_team: str
away_team: str
odds: list[float]
property odd_dict: dict[str, float]

Returns a dictionary mapping the outcomes of a match to their respective odds.

The dictionary contains the following keys: - “H”: Home team win odds - “D”: Draw odds - “A”: Away team win odds

Returns:

A dictionary where the keys are the outcomes (“H”, “D”, “A”) and the values are the corresponding odds as floats.

Return type:

dict[str, float]

property match_id: str
class footix.ProbaResult(proba_home, proba_draw, proba_away)[source]

Bases: NamedTuple

Named tuple for Probabilities.

Parameters:
proba_home: float

Alias for field number 0

proba_draw: float

Alias for field number 1

proba_away: float

Alias for field number 2

class footix.SampleProbaResult(proba_home, proba_draw, proba_away)[source]

Bases: NamedTuple

A NamedTuple representing the probability results for a match outcome.

Parameters:
proba_home

Array of probabilities for the home team winning.

Type:

np.ndarray

proba_draw

Array of probabilities for a draw.

Type:

np.ndarray

proba_away

Array of probabilities for the away team winning.

Type:

np.ndarray

proba_home: ndarray

Alias for field number 0

proba_draw: ndarray

Alias for field number 1

proba_away: ndarray

Alias for field number 2