/** Calculates the expected inter-rater agreement that assumes a * uniform distribution over all raters and annotations. * @throws NullPointerException if the annotation study is null. * @throws ArithmeticException if there are no annotation categories. */ @Override public double calculateExpectedAgreement() { return 1.0 / (double) study.getCategoryCount(); }
/** Calculates the expected inter-rater agreement that assumes a * uniform distribution over all raters and annotations. * @throws NullPointerException if the annotation study is null. * @throws ArithmeticException if there are no annotation categories. */ public double calculateExpectedAgreement() { return 1.0 / (double) study.getCategoryCount(); }
double[] sums = new double[study.getCategoryCount()]; for (Object category1 : study.getCategories()) { Map<Object, Double> c1 = coincidence.get(category1);
categories.put(cat, categories.size()); int[][] frequencies = new int[study.getCategoryCount()][study.getCategoryCount()]; for (ICodingAnnotationItem item : study.getItems()) { int cat1 = categories.get(item.getUnit(0).getCategory()); out.println(); int i = 0; int[] colSum = new int[study.getCategoryCount()]; for (Object category1 : categories.keySet()) { out.print(category1);
public static void dumpStudy(PrintStream aOut, ICodingAnnotationStudy aStudy) { try { aOut.printf("Category count: %d%n", aStudy.getCategoryCount()); } catch (Throwable e) { aOut.printf("Category count: %s%n", ExceptionUtils.getRootCauseMessage(e)); } try { aOut.printf("Item count: %d%n", aStudy.getItemCount()); } catch (Throwable e) { aOut.printf("Item count: %s%n", ExceptionUtils.getRootCauseMessage(e)); } for (ICodingAnnotationItem item : aStudy.getItems()) { StringBuilder sb = new StringBuilder(); for (IAnnotationUnit unit : item.getUnits()) { if (sb.length() > 0) { sb.append(" \t"); } sb.append(unit.getCategory()); } aOut.println(sb); } }
public static void dumpAgreementStudy(PrintStream aOut, AgreementResult aAgreement) { try { aOut.printf("Category count: %d%n", aAgreement.getStudy().getCategoryCount()); } catch (Throwable e) { aOut.printf("Category count: %s%n", ExceptionUtils.getRootCauseMessage(e)); } try { aOut.printf("Item count: %d%n", aAgreement.getStudy().getItemCount()); } catch (Throwable e) { aOut.printf("Item count: %s%n", ExceptionUtils.getRootCauseMessage(e)); } aOut.printf("Relevant position count: %d%n", aAgreement.getRelevantSetCount()); aOut.printf("%n== Complete sets: %d ==%n", aAgreement.getCompleteSets().size()); dumpAgreementConfigurationSetsWithItems(aOut, aAgreement, aAgreement.getCompleteSets()); aOut.printf("%n== Incomplete sets (by position): %d == %n", aAgreement.getIncompleteSetsByPosition().size()); dumpAgreementConfigurationSets(aOut, aAgreement, aAgreement.getIncompleteSetsByPosition()); aOut.printf("%n== Incomplete sets (by label): %d ==%n", aAgreement.getIncompleteSetsByLabel().size()); dumpAgreementConfigurationSets(aOut, aAgreement, aAgreement.getIncompleteSetsByLabel()); aOut.printf("%n== Plurality sets: %d ==%n", aAgreement.getPluralitySets().size()); dumpAgreementConfigurationSets(aOut, aAgreement, aAgreement.getPluralitySets()); }