Math Foundations — Lecture 8
Inter-annotator agreement (Cohen's & Fleiss' kappa, Krippendorff's alpha), observed vs chance agreement, worked examples on imbalanced and balanced classes.
Observed vs chance agreement
Suppose two annotators label \(N\) items into \(K\) categories. The most basic statistic is observed agreement:
But raw \(p_o\) is misleading when one class dominates. If 95% of emails are "not spam" and both annotators just always pick "not spam", they agree 95% of the time without contributing any real labelling skill. We need to correct for chance.
Expected agreement by chance is computed assuming each annotator labels independently according to their own marginal distribution:
Cohen's kappa
Cohen's \(\kappa\) measures agreement above chance, normalised so that perfect agreement gives \(\kappa = 1\) and chance gives \(\kappa = 0\):
Rough guide (Landis & Koch 1977): \(<0\) poor · \(0.0\text{–}0.2\) slight · \(0.2\text{–}0.4\) fair · \(0.4\text{–}0.6\) moderate · \(0.6\text{–}0.8\) substantial · \(0.8\text{–}1.0\) almost perfect. These thresholds are conventional, not statistically motivated.
Worked example 1 — imbalanced classes
Confusion matrix for 100 items, two annotators, two labels \(A, B\):
Observed agreement:
Marginal probabilities:
Chance agreement:
Cohen's kappa:
Despite 88% raw agreement, \(\kappa \approx 0.47\) — only moderate, because the class imbalance inflates \(p_e\).
Worked example 2 — balanced classes
Same observed agreement (98%) but balanced marginals:
Same \(p_o\), but \(\kappa\) is far higher because chance agreement is much lower. Takeaway: always report \(\kappa\), not just raw agreement, especially when classes are unbalanced.
Fleiss' kappa (\(\geq 2\) annotators)
For \(N\) items, \(K\) categories, \(n\) annotators per item. Let \(n_{ij}\) be the number of annotators who assigned item \(i\) to category \(j\), so \(\sum_j n_{ij} = n\).
Per-item agreement (proportion of agreeing pairs):
Average over items, and chance agreement from class-proportion squares:
Reduces to Cohen's kappa when \(n=2\) and annotator identities are ignored.
Krippendorff's alpha
A more general coefficient that supports nominal, ordinal, interval, and ratio data, and handles missing values:
For nominal data with two annotators and no missing values, \(\alpha \approx \kappa\). For ordinal labels (e.g. Likert ratings) Krippendorff's distance function gives partial credit for being "close", which kappa does not.
If agreement is low: diagnose, don't average
- Unclear guidelines — annotators interpret edge cases differently. Fix: add worked examples for the disputed cases.
- Careless annotators — failed attention checks, fast clicks. Fix: block them, requalify, or use redundancy.
- Ambiguous items — genuine label uncertainty in the data. Fix: flag and adjudicate, or accept multiple gold labels.
- Subjective task — sentiment, offence, humour. Accept that there is no single ground truth; report distribution of labels.
Annotation is iterative: low kappa is information about your schema and annotators, not a final verdict on the data.