fixtures
fixtures
¶
Fixture difficulty signals.
FixtureSignal
¶
Bases: BaseSignal
Generate signals based on fixture difficulty and schedule.
Initialize with team difficulty ratings.
| PARAMETER | DESCRIPTION |
|---|---|
difficulty_ratings
|
Team strength ratings (1-5, higher = harder opponent)
TYPE:
|
Source code in fplx/signals/fixtures.py
generate_signal
¶
Generate fixture-based signal.
Source code in fplx/signals/fixtures.py
set_difficulty_ratings
¶
Set or update difficulty ratings.
| PARAMETER | DESCRIPTION |
|---|---|
ratings
|
Team strength ratings
TYPE:
|
compute_fixture_difficulty
¶
compute_fixture_difficulty(
team: str,
upcoming_opponents: list[str],
is_home: list[bool],
) -> float
Compute fixture difficulty score for upcoming games.
| PARAMETER | DESCRIPTION |
|---|---|
team
|
Player's team
TYPE:
|
upcoming_opponents
|
List of upcoming opponent teams
TYPE:
|
is_home
|
Whether each fixture is home
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Difficulty score (lower = easier fixtures) |
Source code in fplx/signals/fixtures.py
compute_fixture_advantage
¶
compute_fixture_advantage(
team: str,
upcoming_opponents: list[str],
is_home: list[bool],
) -> float
Compute fixture advantage (inverse of difficulty).
Higher score = easier fixtures = better for player.
| PARAMETER | DESCRIPTION |
|---|---|
team
|
Player's team
TYPE:
|
upcoming_opponents
|
List of upcoming opponent teams
TYPE:
|
is_home
|
Whether each fixture is home
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Advantage score (0-1, higher = better fixtures) |
Source code in fplx/signals/fixtures.py
compute_fixture_congestion
¶
Compute fixture congestion (number of games in short period).
| PARAMETER | DESCRIPTION |
|---|---|
fixtures
|
Fixtures dataframe
TYPE:
|
team
|
Team name
TYPE:
|
days_window
|
Days to look ahead
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
float
|
Congestion score (0-1, higher = more congested) |
Source code in fplx/signals/fixtures.py
batch_compute_advantages
¶
batch_compute_advantages(
players_teams: dict[str, str],
fixtures_data: dict[str, tuple],
) -> dict[str, float]
Compute fixture advantages for multiple players.
| PARAMETER | DESCRIPTION |
|---|---|
players_teams
|
Mapping of player ID to team
TYPE:
|
fixtures_data
|
Mapping of team to (opponents, is_home) tuples
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, float]
|
Dictionary of player fixture advantage scores |