Alpha
evalica.alpha(data, distance='nominal', solver='pyo3')
Compute Krippendorff's alpha.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
DataFrame
|
Ratings by observer (rows) and unit (columns). |
required |
distance
|
DistanceFunc[T_distance_contra] | DistanceName
|
Distance metric (nominal, ordinal, interval, ratio) or a custom function. |
'nominal'
|
solver
|
Literal['naive', 'pyo3']
|
The solver to use (naive or pyo3). |
'pyo3'
|
Returns:
| Type | Description |
|---|---|
AlphaResult
|
The alpha result. |
Source code in evalica/__init__.py
1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 | |
evalica.AlphaResult
dataclass
The result of Krippendorff's alpha.
Attributes:
| Name | Type | Description |
|---|---|---|
alpha |
float
|
The alpha value. |
observed |
float
|
The observed disagreement. |
expected |
float
|
The expected disagreement. |
solver |
str
|
The solver used. |
Source code in evalica/__init__.py
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | |
evalica.DistanceFunc
Bases: Protocol[T_distance_contra]
The distance function protocol.
Source code in evalica/__init__.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
__call__(left, right)
Compute the distance between the values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
left
|
T_distance_contra
|
The left-hand side value. |
required |
right
|
T_distance_contra
|
The right-hand side value. |
required |
Returns:
| Type | Description |
|---|---|
float
|
The non-negative distance between the values. |
Source code in evalica/__init__.py
131 132 133 134 135 136 137 138 139 140 141 142 143 | |