001package org.dllearner.accuracymethods;
002
003import org.dllearner.core.ComponentAnn;
004import org.dllearner.learningproblems.Heuristics;
005
006@ComponentAnn(name = "Predictive Accuracy without Weak elimination", shortName = "pred_acc.ocel", version = 0)
007public class AccMethodPredAccOCEL implements AccMethodTwoValued, AccMethodNoWeakness {
008
009        public AccMethodPredAccOCEL() {
010        }
011
012        public AccMethodPredAccOCEL(boolean init) {
013                if (init) init();
014        }
015
016        @Override
017        public void init() {
018        }
019
020        @Override
021        public double getAccOrTooWeak2(int tp, int fn, int fp, int tn, double noise) {
022                int posExamples = tp + fn;
023                int allExamples = posExamples + fp + tn;
024
025                return Heuristics.divideOrZero( tp + tn, allExamples );
026        }
027
028}