Bradley-Terry¶
- evalica.bradley_terry(xs, ys, winners, index=None, weights=None, win_weight=1.0, tie_weight=0.5, solver='pyo3', tolerance=1e-06, limit=100, **kwargs)[source]¶
Compute the Bradley-Terry scores for the given pairwise comparison.
Note
Bradley, R.A., Terry, M.E.: Rank Analysis of Incomplete Block Designs: I. The Method of Paired Comparisons. Biometrika. 39, 324–345 (1952). <https://doi.org/10.2307/2334029>.
Note
Newman, M.E.J.: Efficient Computation of Rankings from Pairwise Comparisons. Journal of Machine Learning Research. 24, 1–25 (2023). <https://www.jmlr.org/papers/v24/22-1086.html>.
- Parameters:
xs (Collection[T_contra]) – The left-hand side elements.
ys (Collection[T_contra]) – The right-hand side elements.
winners (Collection[Winner]) – The winner elements.
index (Index | None) – The index.
weights (Collection[float] | None) – The example weights.
win_weight (float) – The win weight.
tie_weight (float) – The tie weight.
solver (Literal['naive', 'pyo3']) – The solver.
tolerance (float) – The convergence tolerance.
limit (int) – The maximum number of iterations.
**kwargs (Any) – The additional arguments.
- Returns:
The Bradley-Terry result.
- Return type:
- class evalica.BradleyTerryResult(scores, index, win_weight, tie_weight, solver, tolerance, iterations, limit)[source]¶
The Bradley-Terry result.
- Parameters:
- scores¶
The element scores.
- Type:
- index¶
The index.
- Type:
- solver¶
The solver.
- Type:
Literal[‘naive’, ‘pyo3’]
- evalica.newman(xs, ys, winners, index=None, v_init=0.5, weights=None, win_weight=1.0, tie_weight=1.0, solver='pyo3', tolerance=1e-06, limit=100, **kwargs)[source]¶
Compute the scores for the given pairwise comparison using the Newman’s algorithm.
Note
Newman, M.E.J.: Efficient Computation of Rankings from Pairwise Comparisons. Journal of Machine Learning Research. 24, 1–25 (2023). <https://www.jmlr.org/papers/v24/22-1086.html>.
- Parameters:
xs (Collection[T_contra]) – The left-hand side elements.
ys (Collection[T_contra]) – The right-hand side elements.
winners (Collection[Winner]) – The winner elements.
index (Index | None) – The index.
v_init (float) – The initial tie parameter.
weights (Collection[float] | None) – The example weights.
win_weight (float) – The win weight.
tie_weight (float) – The tie weight.
solver (Literal['naive', 'pyo3']) – The solver.
tolerance (float) – The convergence tolerance.
limit (int) – The maximum number of iterations.
**kwargs (Any) – The additional arguments.
- Returns:
The Newman’s result.
- Return type: