Cohen's kappa measures agreement between two raters beyond what chance would give:
where is observed agreement and uses each rater's label frequencies.
Implement cohens_kappa(a, b) for any label set. If (both raters always say the same single label), return 1.0.