Quant Memo
Core

Cohen's Kappa and Inter-Rater Agreement

A statistic for how well two labelers agree that corrects for the agreement you'd expect from chance alone — essential whenever you're checking if two analysts, models, or data vendors are really seeing the same thing.

Prerequisites: The Confusion Matrix and Classification Metrics

Two research analysts independently label a year of news headlines as "bullish", "bearish", or "neutral" for a sentiment-classification model, and you want to know if they actually agree on what the words mean, or if the model's training labels are just noise. You count how often their labels match: 82%. That sounds solid — until you realize that if most headlines are neutral and both analysts default to "neutral" whenever unsure, two people guessing independently would already agree most of the time by pure chance. Raw agreement can't tell real signal from that background hum. Cohen's kappa fixes this by asking: how much better is the observed agreement than the agreement you'd get if both raters were labeling randomly, given how often each of them uses each label?

An analogy: grading on a curve for chance

Imagine two exam graders marking essays pass/fail, where 90% of essays are obviously passes. Two graders who barely read the essays and just guessed "pass" 90% of the time would still agree with each other about 82% of the time purely by coincidence of both guessing the majority label. If you saw 82% raw agreement between real graders, you'd have no idea whether they were reading carefully or barely trying. Kappa subtracts out that "guessing baseline" so what's left measures actual shared judgment.

The formula, one piece at a time

Let pop_o be the observed agreement — the fraction of items where the two raters gave the same label. Let pep_e be the expected agreement by chance — the agreement rate you'd predict just from each rater's own label frequencies, if their labels were statistically independent of each other. Cohen's kappa is

κ=pope1pe.\kappa = \frac{p_o - p_e}{1 - p_e}.

In plain English: kappa measures how much of the possible improvement over chance agreement (the gap between perfect agreement, 1, and chance agreement, pep_e) was actually achieved. κ=1\kappa = 1 means perfect agreement, κ=0\kappa = 0 means the raters do no better than chance, and negative values mean they agree less than chance would predict — a sign something is systematically wrong, like one rater using an inverted convention.

Worked example 1: the sentiment labels

Suppose over 1,000 headlines, analyst A labels 100 bearish, 100 bullish, 800 neutral, and analyst B labels 120 bearish, 80 bullish, 800 neutral, with 820 headlines matching exactly, so po=820/1000=0.82p_o = 820/1000 = 0.82. Chance agreement is computed label by label from each rater's marginal frequencies: pe=(0.10)(0.12)+(0.10)(0.08)+(0.80)(0.80)=0.012+0.008+0.64=0.66p_e = (0.10)(0.12) + (0.10)(0.08) + (0.80)(0.80) = 0.012 + 0.008 + 0.64 = 0.66. Then

κ=0.820.6610.66=0.160.340.47.\kappa = \frac{0.82 - 0.66}{1 - 0.66} = \frac{0.16}{0.34} \approx 0.47.

A kappa of 0.47 is only "moderate" agreement by the usual rule of thumb (0.41–0.60), despite 82% raw agreement looking impressive — most of that 82% was the neutral-label chance overlap.

Worked example 2: a rare-event flag

Now suppose two data vendors flag corporate filings as "fraud risk" or not, and fraud flags are rare: vendor A flags 2% of filings, vendor B flags 3%, and they agree on 96.5% of filings overall, so po=0.965p_o = 0.965. Chance agreement: pe=(0.02)(0.03)+(0.98)(0.97)=0.0006+0.9506=0.9512p_e = (0.02)(0.03) + (0.98)(0.97) = 0.0006 + 0.9506 = 0.9512. Then κ=(0.9650.9512)/(10.9512)=0.0138/0.04880.28\kappa = (0.965 - 0.9512)/(1 - 0.9512) = 0.0138/0.0488 \approx 0.28 — "fair" agreement at best, even though 96.5% raw agreement looks close to flawless. With a rare label, near-total agreement is nearly automatic (both vendors saying "no risk" almost always), so kappa is doing real work exposing how little the vendors actually agree on the flags that matter.

chance agreement p_e = 0.66 κ slice observed agreement p_o = 0.82 κ = (0.82 − 0.66) / (1 − 0.66) ≈ 0.47 of the remaining gap to perfect agreement
Of the 82% observed agreement, most (0.66) is exactly what two independent guessers would achieve by chance; kappa measures how much of the remaining gap to perfect agreement — the thin slice on the right — was actually closed.
0.82 0.47 sentiment: raw vs κ 0.965 0.28 fraud flag: raw vs κ
Raw agreement (light bars) looks similarly high in both cases, but kappa (dark bars) reveals the rare-event fraud flags carry far less real shared judgment once chance overlap is removed.

What this means in practice

Kappa is the standard check before trusting any hand-labeled dataset used to train or validate a model — sentiment tags, fraud flags, earnings-call topic labels, chart-pattern annotations. If two labelers (or a labeler and a model) show low kappa, the "ground truth" itself is unreliable, and no downstream model can be trusted to exceed the quality of the labels it learned from. It's also used to sanity-check agreement between two data vendors' classifications before merging their feeds, since silently trusting a vendor with 20% hidden disagreement can corrupt a signal without any obvious symptom.

Cohen's kappa is raw agreement corrected for the agreement two independent guessers would achieve just from each rater's own label frequencies: κ=(pope)/(1pe)\kappa = (p_o - p_e)/(1 - p_e), so it exposes cases where high raw agreement is mostly a statistical artifact of imbalanced labels.

The classic mistake is reading raw percent agreement as meaningful on its own, especially with imbalanced labels — a 95%+ agreement rate can hide a kappa near zero when one label dominates, because both raters can achieve near-total agreement just by defaulting to the majority label most of the time. Always compute pep_e from the actual label frequencies before trusting an agreement number, and be extra suspicious of high raw agreement on rare-event flags like fraud or default labels.

Related concepts

Practice in interviews

Further reading

  • Cohen, Educational and Psychological Measurement (1960)
  • Fleiss, Statistical Methods for Rates and Proportions, ch. 18
ShareTwitterLinkedIn