Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

chronax.win_rate

Calculates Average Win Rate.

WinRate

chronax.win_rate.WinRate · inherits BaseAggregator

Class to compute average win rate for models.

Average win rate W_j represents the probability that model j achieves lower error than another randomly chosen model k != j on a randomly chosen task.

__init__(self, pivot_table: pd.DataFrame)

Initialize the WinRate aggregator.

Parameter Type Default Description
pivot_table pd.DataFrame - DataFrame with models as index, tasks as columns, scores as values

__call__(self) -> pd.Series

Compute average win rate for each model.

Formula: W_j = (1 / (num_tasks * (num_models - 1))) * Σ_r Σ_k≠j [1(E_rj < E_rk) + 0.5 * 1(E_rj = E_rk)]

Where: - num_tasks = number of tasks - num_models = number of models - E_rj = error of model j on task r - 1(condition) = indicator function (1 if true, 0 otherwise)

Returns: pd.Series (Series with average win rate for each model.)

average_win_rate_across_metrics

chronax.win_rate.average_win_rate_across_metrics

Mean of per-metric win rates: for each metric pivot, compute WinRate; for each model, average those rates (skipping NaN). Each metric weights equally—unlike pooling all task×metric comparisons, which overweights metrics with more tasks or windows.

Parameter Type Default Description
pivot_tables Dict[str, pd.DataFrame] - (undocumented)

Returns: pd.Series (undocumented)