Set<Category> categories = new HashSet<Category>();
Category relevant = new Category("1");
Category irrelevant = new Category("0");
categories.add(relevant);
categories.add(irrelevant);
DawidSkene ds = new DawidSkene(categories);
ds.addMisclassificationCost(new MisclassificationCost(relevant.getName(), relevant.getName(), 0.0));
ds.addMisclassificationCost(new MisclassificationCost(irrelevant.getName(), irrelevant.getName(), 0.0));
ds.addMisclassificationCost(new MisclassificationCost(relevant.getName(), irrelevant.getName(), 1.0));
ds.addMisclassificationCost(new MisclassificationCost(irrelevant.getName(), relevant.getName(), 1.0));
for (Vote vote : votes ) {
if (vote.sequence <= threshold ) {
AssignedLabel l = new AssignedLabel( vote.worker, vote.unit, vote.label);
ds.addAssignedLabel(l);
}
}
ds.estimate( 20 );
return ds.getMajorityVote();
}