Turn yesterday's hand-calc into running code — then use the disagreements as a map of your guideline's blind spots
Day 13 of 66
You computed Cohen's kappa by hand yesterday. Today you make a machine do it — once — so you can run it on real label data any time someone asks "is this task well-specified?" Building the metric yourself, rather than importing a black box, is the point: when you've watched the chance term move the answer, you'll never misread a kappa again.
The "Try This — On Real Data" box (injected for build days) contains agreement.py. Type it in rather than pasting — read every line. It computes percent agreement, the chance term, and kappa exactly as you did by hand, then lists the items where the two raters disagreed.
When it runs, you'll get three numbers and a list. Read them in order, the way a lead would in a quality review:
This is the Week 2 lesson made quantitative. Every item where two careful raters split is a place your guideline failed to decide the case for them. The disagreement list isn't noise to average away — it's a ranked to-do list for your next guideline revision. Pull each disagreed item, ask "what rule would have forced the same answer?", and write that rule. That loop — measure agreement → inspect disagreements → tighten the guideline → re-measure — is the highest-leverage move you own as a data lead.
The sample data proves the math. The value is in your data. Pull two raters' labels on the same batch from a real xAI task — even 15–20 shared items is enough — swap them into agreement.py, and run it. Then open the disagreement list and write one guideline sentence for each split. That artifact — a kappa plus a list of guideline fixes derived from it — is exactly what makes a quality review credible. Screenshot the output; it goes in your portfolio next to your Week 2 rubric.
Keep it policy-safe: use labels and item IDs, not the raw flagged content, when the task touches sensitive material. You're measuring the labeling process, and you can do that with the labels alone.
An IC runs the agreement script and reports the kappa. A lead treats the disagreement list as the real output — a ranked map of where the guideline failed to decide the case — and owns the loop that turns each split into a new rule, then proves agreement climbed.
Say this in an interview: "The kappa is the headline, but the deliverable is the disagreement list. Every item two careful raters split on is a precise pointer to a guideline hole, so I write a rule for each and re-measure to prove the fix moved the number."