dkpro / dkpro-statistics

DKPro Statistics
https://dkpro.github.io/dkpro-statistics
Apache License 2.0
12 stars 4 forks source link

Div-by-zero after upgrading from 1.0.2 to 2.0.0 #12

Closed chmeyer closed 9 years ago

chmeyer commented 9 years ago

Originally reported on Google Code with ID 12

After upgrading from the 1.0.2 TwoRaterAgreement to the 2.0.0 CohenAgreement, I get
this error when passing in an empty study:

java.lang.ArithmeticException: Division undefined
    at java.math.BigDecimal.divide(BigDecimal.java:1668)
    at de.tudarmstadt.ukp.dkpro.statistics.agreement.coding.CohenKappaAgreement.calculateExpectedAgreement(CohenKappaAgreement.java:68)
    at de.tudarmstadt.ukp.dkpro.statistics.agreement.AgreementMeasure.calculateAgreement(AgreementMeasure.java:42)
    at de.tudarmstadt.ukp.clarin.webanno.brat.curation.AgreementUtils.getTwoRaterAgreement(AgreementUtils.java:85)
    at de.tudarmstadt.ukp.clarin.webanno.brat.curation.CasDiff2Test.twoEmptyCasTest(CasDiff2Test.java:121)
        ...

Before, I got a NaN as agreement score.

Reported by richard.eckart on 2015-05-10 06:52:09

chmeyer commented 9 years ago

Fixed in version 2.1.0. Please note: Neither ArithmeticException not NaN will be returned, but the newly created InsufficientDataException will be raised in this case.