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 | |
Draw = ...
class-attribute
instance-attribute
There is a tie.
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]
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
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
evalica.matrices(xs_indexed, ys_indexed, winners, index, weights=None)
Build win and tie matrices from the given elements.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
xs_indexed
|
Collection[int]
|
The left-hand side elements. |
required |
ys_indexed
|
Collection[int]
|
The right-hand side elements. |
required |
winners
|
Collection[Winner]
|
The winner elements. |
required |
index
|
dict[T, int]
|
The index. |
required |
weights
|
Collection[float] | None
|
The example weights. |
None
|
Returns:
| Type | Description |
|---|---|
MatricesResult[T]
|
The win and tie matrices. |
Source code in evalica/__init__.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
evalica.MatricesResult
dataclass
Bases: Generic[T]
The win and tie matrices.
Attributes:
| Name | Type | Description |
|---|---|---|
win_matrix |
NDArray[float64]
|
The matrix representing wins between the elements. |
tie_matrix |
NDArray[float64]
|
The matrix representing ties between the elements; it is always symmetric. |
index |
dict[T, int]
|
The index. |
Source code in evalica/__init__.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 | |
evalica.Result
Bases: Protocol[T]
The result protocol.
Attributes:
| Name | Type | Description |
|---|---|---|
scores |
Series[float]
|
The element scores. |
index |
dict[T, int]
|
The index. |
Source code in evalica/__init__.py
161 162 163 164 165 166 167 168 169 170 171 172 173 | |
evalica.pairwise_frame(scores)
Create a data frame out of the estimated pairwise scores.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scores
|
Series[float]
|
The element scores. |
required |
Returns:
| Type | Description |
|---|---|
DataFrame
|
The data frame representing pairwise scores between the elements. |
Source code in evalica/__init__.py
987 988 989 990 991 992 993 994 995 996 997 998 | |
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
963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 | |
evalica.__version__ = ...
module-attribute
The version of Evalica.