Cohen Kappa: Observed Agreement and Chance Baseline
2026-11-07

Cohen Kappa: Observed Agreement and Chance Baseline

Cohen kappa compares how often two reviewers assign the same label with the agreement expected from their separate label frequencies. Two labeling tables can have the same observed agreement and still give different kappa scores. The difference comes from the chance baseline used by the calculation.

Pair the labels on the same items

Consider two people reading the same group of fictional robot inspection clips. Each person assigns one of two labels to every included clip. The input is a pair of labels for each clip. Reading two independent lists without knowing which items correspond would lose the information about whether the reviewers agreed on each item.

The statsmodels Cohen kappa reference uses a square table with one rater in the rows and the other in the columns. The first figure illustrates that table. Each diagonal cell counts matches for its category. Adding those diagonal counts and dividing by all paired items gives the observed proportion of agreement. The off-diagonal cells retain information about which label pair appeared when the reviewers differed.

The paired table has diagonal 40 and 40, off-diagonal 10 and 10, and marginal totals of 50.
The diagonal gives observed agreement. Row and column totals give the two label mixes. Source: Zhilianhai editorial desk, original AI-assisted conceptual illustration.

Each reviewer's category frequencies define the baseline

The scikit-learn Cohen kappa reference describes expected agreement using an empirical label distribution for each annotator. In the table, the row totals show how often the first reviewer uses each label. The column totals show the same thing for the second reviewer. Dividing each total by the number of pairs gives the two sets of marginal frequencies.

Imagine combining two independent draws from those frequencies. The chance of both draws producing the first category is the first reviewer's frequency for that category multiplied by the second reviewer's frequency for it. The same calculation applies to the other category. Adding the matching-category products gives expected agreement. The baseline follows the observed mix of labels, rather than assuming each category is equally frequent.

Those independent draws define a comparison model. They preserve how often each reviewer used each label while removing the pairing between labels on individual clips. The baseline therefore answers what matching would look like if the two distributions were combined independently. It says nothing about whether the real reviewers guessed, consulted a rubric, or shared the same reason for choosing a label.

The score scales agreement above that baseline

The formula subtracts expected agreement from observed agreement and divides by one minus expected agreement. The numerator describes how far the observed proportion is above or below the baseline. The denominator is the distance from the baseline to perfect agreement. A score of zero occurs when observed and expected agreement are equal. A negative value occurs when observed agreement is lower than the baseline.

The denominator matters at the boundary. If both reviewers assign the same single category to every item, their observed agreement is complete. Their chance baseline is also complete because each empirical distribution is concentrated on that category. The formula then has a zero denominator, so the unweighted score is undefined. A report can keep the raw agreement and mark the statistic as undefined for that label distribution.

Two examples can share eighty percent observed agreement

In the first invented table, both reviewers assign the two categories equally often. They agree on forty items in each category, and each direction of disagreement occurs ten times. Out of one hundred items they agree on eighty. The expected agreement is one half times one half for each category, added together to give one half. The kappa score is therefore zero point six.

In a second invented table, seventy-five items agree in the common category and five agree in the less frequent one. Again there are ten disagreements in each direction. The observed agreement remains eighty percent. Each reviewer now assigns the common category eighty-five percent of the time, so the expected agreement is eighty-five percent squared plus fifteen percent squared, or seventy-four point five percent. Kappa is about zero point two one six. The second figure keeps the two observed rates on the same scale so the different baseline distances remain visible.

Balanced and skewed cases share 80% observed agreement with expected rates of 50.0% and 74.5%.
The skewed case has less agreement above its chance baseline and a smaller kappa. Source: Zhilianhai editorial desk, original AI-assisted conceptual illustration.

Preserve what the two labels and the score represent

Neither reviewer supplies a reference truth in these examples. Agreement describes whether the two labels match. An accuracy estimate would require a separate account of which label serves as the reference. The unweighted statistic also treats all category disagreements alike. The cited interfaces offer weighted versions for other comparison rules, which need their own interpretation.

A useful data record keeps the paired-item count, category names, table, observed agreement, expected agreement and weighting choice. The table can show whether a higher or lower score came with a different label mix. This preserves information that the single coefficient necessarily compresses. Related explanations appear in the robot data analysis collection and technical article directory.

18028484626 CONTACT US

公司:智联海(惠州)科技有限公司

地址:惠州仲恺高新区陈江街道白云山工业大道 5 号六楼 601

Q Q:18028484626

Copyright © 2002-2026

粤xxx

咨询 在线留言 电话:18028484626
微信 微信扫码添加我