Class CohenKappaAgreement
java.lang.Object
org.dkpro.statistics.agreement.AgreementMeasure
org.dkpro.statistics.agreement.coding.CodingAgreementMeasure
org.dkpro.statistics.agreement.coding.CohenKappaAgreement
- All Implemented Interfaces:
ICodingAgreementMeasure,IAgreementMeasure,ICategorySpecificAgreement,IChanceCorrectedAgreement
public class CohenKappaAgreement extends CodingAgreementMeasure implements IChanceCorrectedAgreement, ICategorySpecificAgreement
Implementation of Cohen's kappa (1960) for calculating a chance-corrected inter-rater agreement
for two raters. The measure assumes a different probability distribution for all raters.
References:
References:
- Artstein, R. & Poesio, M.: Inter-Coder Agreement for Computational Linguistics. Computational Linguistics 34(4):555-596, 2008.
- Cohen, J.: A Coefficient of Agreement for Nominal Scales. Educational and Psychological Measurement 20(1):37-46, 1960.
- Author:
- Christian M. Meyer
-
Field Summary
-
Constructor Summary
Constructors Constructor Description CohenKappaAgreement(ICodingAnnotationStudy study)Initializes the instance for the given annotation study. -
Method Summary
Modifier and Type Method Description doublecalculateCategoryAgreement(java.lang.Object category)Calculates the inter-rater agreement for the given category.doublecalculateExpectedAgreement()Calculates the expected inter-rater agreement that assumes a different probability distribution for all raters.doublecalculateMaximumAgreement()Computes the maximum possible value of the kappa coefficient for the provided study.protected doublecalculateMaximumObservedAgreement()Methods inherited from class org.dkpro.statistics.agreement.coding.CodingAgreementMeasure
calculateObservedAgreement, doCalculateItemAgreement, ensureTwoRaters, warnIfMissingValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.dkpro.statistics.agreement.IAgreementMeasure
calculateAgreementMethods inherited from interface org.dkpro.statistics.agreement.IChanceCorrectedAgreement
calculateObservedAgreement
-
Constructor Details
-
CohenKappaAgreement
Initializes the instance for the given annotation study. The study may never be null.
-
-
Method Details
-
calculateExpectedAgreement
public double calculateExpectedAgreement()Calculates the expected inter-rater agreement that assumes a different probability distribution for all raters.- Specified by:
calculateExpectedAgreementin interfaceIChanceCorrectedAgreement- Overrides:
calculateExpectedAgreementin classAgreementMeasure- Throws:
java.lang.NullPointerException- if the annotation study is null.java.lang.ArithmeticException- if there are no items in the annotation study.
-
calculateMaximumObservedAgreement
protected double calculateMaximumObservedAgreement() -
calculateMaximumAgreement
public double calculateMaximumAgreement()Computes the maximum possible value of the kappa coefficient for the provided study. In case of balanced off-marginals (i.e., an equal disagreement for each pair of categories), the maximum kappa is 1. In other cases, it decreases with a higher discrepancy of the distribution of disagreements. -
calculateCategoryAgreement
public double calculateCategoryAgreement(java.lang.Object category)Description copied from interface:ICategorySpecificAgreementCalculates the inter-rater agreement for the given category.- Specified by:
calculateCategoryAgreementin interfaceICategorySpecificAgreement- See Also:
ICategorySpecificAgreement
-