001package org.dllearner.accuracymethods; 002 003import org.dllearner.core.ComponentAnn; 004import org.dllearner.learningproblems.Heuristics; 005 006@ComponentAnn(name = "Jaccard Coefficient", shortName = "jaccard", version = 0.1) 007public class AccMethodJaccard implements AccMethodTwoValued { 008 009 public AccMethodJaccard() {} 010 011 public AccMethodJaccard(boolean init) { 012 if(init)init(); 013 } 014 015 @Override 016 public void init() { 017 } 018 019 @Override 020 public double getAccOrTooWeak2(int tp, int fn, int fp, int tn, double noise) { 021 if(tp / (double) (tp+fn) <= 1 - noise) { 022 return -1; 023 } 024 return Heuristics.getJaccardCoefficient(tp, tp + fn + fp); 025 } 026 027}