skill_score.py
Calculates Skill Score.
SkillScore
chronax.skill_score.SkillScore · inherits BaseAggregator
Class to compute skill score for models compared to a baseline.
Skill score S_j quantifies how much model j reduces forecasting error compared to the fixed baseline model β on average.
__init__(self, pivot_table, baseline_model="seasonal_naive")
Initialize the SkillScore aggregator.
| Parameter | Type | Default | Description |
|---|---|---|---|
pivot_table |
pd.DataFrame |
- | DataFrame with models as index, tasks as columns, scores as values |
baseline_model |
str |
"seasonal_naive" |
Name of the baseline model for skill score calculation |
__call__(self) -> pd.Series
Compute skill score for each model compared to baseline.
Formula: S_j = 1 - (Π_r clip(E_rj / E_rβ; l, u))^(1/R)
Where: - E_rj = error of model j on task r - E_rβ = error of baseline model β on task r - clip(x; l, u) = max(l, min(x, u)) - l = 10^-2 = 0.01 (lower bound) - u = 100 (upper bound) - R = number of tasks
Returns: pd.Series (Series with skill score for each model).