Utilities
evalica.Winner
Bases: Enum
The outcome of the pairwise comparison.
Source code in evalica/evalica.pyi
11 12 13 14 15 16 17 18 19 20 | |
Draw = ...
class-attribute
instance-attribute
There is a tie.
Ignore = ...
class-attribute
instance-attribute
The comparison should be ignored.
X = ...
class-attribute
instance-attribute
The first element won.
Y = ...
class-attribute
instance-attribute
The second element won.
evalica.WINNERS = [Winner.X, Winner.Y, Winner.Draw, Winner.Ignore]
module-attribute
Known values of Winner.
evalica.indexing(xs, ys, index=None)
Map the input elements into their numerical representations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xs
|
Collection[T]
|
The left-hand side elements. |
required |
ys
|
Collection[T]
|
The right-hand side elements. |
required |
index
|
dict[T, int] | None
|
The pre-computed index. |
None
|
Returns:
| Type | Description |
|---|---|
tuple[list[int], list[int], dict[T, int]]
|
The tuple containing the numerical representations of the input elements and the corresponding index. |
Source code in evalica/__init__.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
evalica.matrices(xs_indexed, ys_indexed, ws, index)
Build win and tie matrices from the given elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xs_indexed
|
ArrayLike
|
The left-hand side elements. |
required |
ys_indexed
|
ArrayLike
|
The right-hand side elements. |
required |
ws
|
Collection[Winner]
|
The winner elements. |
required |
index
|
dict[T, int]
|
The index. |
required |
Returns:
| Type | Description |
|---|---|
MatricesResult[T]
|
The win and tie matrices. |
Source code in evalica/__init__.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | |
evalica.MatricesResult
dataclass
Bases: Generic[T]
The win and tie matrices.
Attributes:
| Name | Type | Description |
|---|---|---|
win_matrix |
NDArray[int64]
|
The matrix representing wins between the elements. |
tie_matrix |
NDArray[int64]
|
The matrix representing ties between the elements; it is always symmetric. |
index |
dict[T, int]
|
The index. |
Source code in evalica/__init__.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | |
evalica.pairwise_frame(scores)
Create a data frame out of the estimated pairwise scores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scores
|
Series[T]
|
The element scores. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
The data frame representing pairwise scores between the elements. |
Source code in evalica/__init__.py
791 792 793 794 795 796 797 798 799 800 801 802 | |
evalica.pairwise_scores(scores, solver='pyo3')
Estimate the pairwise scores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scores
|
NDArray[float64]
|
The element scores. |
required |
solver
|
Literal['naive', 'pyo3']
|
The solver. |
'pyo3'
|
Returns:
| Type | Description |
|---|---|
NDArray[float64]
|
The matrix representing pairwise scores between the elements. |
Source code in evalica/__init__.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 | |
evalica.__version__ = ...
module-attribute
The version of Evalica.