Define standard reliability and agreement measures.
Compute Cohen’s kappa for two annotators.
Assumes that the annotators draw annotations at random with different but constant frequencies.
See also pairwise_matrix().
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Compute Cohen’s weighted kappa for two annotators.
Assumes that the annotators draw annotations at random with different but constant frequencies. Disagreements are weighted by a weights w_ij representing the “seriousness” of disagreement. For ordered codes, it is often set to the distance from the diagonal, i.e. w_ij = |i-j|.
When w_ij is 0.0 on the diagonal and 1.0 elsewhere, Cohen’s weighted kappa is equivalent to Cohen’s kappa.
See also: diagonal_distance(), binary_distance(), cohens_kappa(), pairwise_matrix()
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Compute Fleiss’ kappa for multiple annotators.
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Compute Krippendorff’s alpha for multiple annotators.
References:
See also: diagonal_distance(), binary_distance(),
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Return Scott’s pi statistic for two annotators.
Assumes that the annotators draw random annotations with the same frequency as the combined observed annotations.
See also pairwise_matrix().
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Standard reliability and covariation measures.
Compute Cronbach’s alpha.
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Compute Pearson’s product-moment correlation coefficient.
See also pairwise_matrix().
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Compute Spearman’s rank correlation coefficient.
See also pairwise_matrix().
References:
Parameters: |
|
---|---|
Returns: | stat (float) - The value of the statistics |
Definition of distance measures between classes.
Return True if all annotations are invalid.
Return the chance-adjusted agreement given the specified agreement and expected agreement.
Defined by (observed_agreement - chance_agreement)/(1.0 - chance_agreement)
Parameters: |
|
---|
Expected frequency of agreement by random annotations.
Assumes that the annotators draw annotations at random with different but constant frequencies.
Parameters: |
|
---|
Expected frequency of agreement by random annotations.
Assumes that the annotators draw random annotations with the same frequency as the combined observed annotations.
Parameters: |
|
---|
Build coincidence matrix.
The element c,k of the coincidence matrix contains the number of c-k pairs in the data (across annotators), over the total number of observed pairs.
Reference
Parameters: |
|
---|---|
Returns: | coinc_mat (ndarray, shape = (n_classes, n_classes)) - Coincidence matrix |
Infer the number of label classes from the data.
Compute confusion matrix from pairs of annotations.
References
Parameters: |
|
---|---|
Returns: | conf_mat (ndarray, shape = (n_classes, n_classes)) - Confusion matrix; conf_mat[i,j] = number of observations that was annotated as category i by annotator 1 and as j by annotator 2 |
Observed frequency of agreement by two annotators.
If a category is never observed, the frequency for that category is set to 0.0 .
Only count entries where both annotators responded toward observed frequency.
Parameters: |
|
---|
Compute the matrix of all combinations of a pairwise statistics.
This function applies an agreement or covariation statistic that is only defined for pairs of annotators to all combinations of annotators pairs, and returns a matrix of the result.
Example
>>> from pyanno.measures import pairwise_matrix, cohens_kappa
>>> stat_matrix = pairwise_matrix(cohens_kappa, annotations, nclasses=4)
Parameters: |
|
---|---|
Returns: | stat_matrix (ndarray, shape = (n_annotators, n_annotators)) - stat_matrix[i,j] is the value of pairwise_statistics applied to the annotations of annotators i and j |