MCPcopy Index your code
hub / github.com/WinVector/Logistic / accuracy

Method accuracy

src/com/winvector/opt/impl/HelperFns.java:70–79  ·  view source on GitHub ↗
(final DModel<T> fn, final Iterable<T> as, final double[] x)

Source from the content-addressed store, hash-verified

68 }
69
70 public static <T extends ExampleRow> double accuracy(final DModel<T> fn, final Iterable<T> as, final double[] x) {
71 final AccuracyCounter<T> counter = new AccuracyCounter<T>(fn,x);
72 final Log log = LogFactory.getLog(fn.getClass());
73 final String logString = fn.getClass().getName() + " accuracy scan";
74 final ThreadedReducer<T,AccuracyCounter<T>,AccuracyCounter<T>> reducer = new ThreadedReducer<T,AccuracyCounter<T>,AccuracyCounter<T>>(5,logString);
75 reducer.reduce(as,counter);
76 final double accuracy = counter.nGood/(double)counter.n;
77 log.info("accuarcy: " + counter.nGood + "/" + counter.n + " = " + accuracy);
78 return accuracy;
79 }
80
81 public static double dot(final Datum row, final double[] o, final int startIndex) {
82 double r = 0.0;

Callers 7

testBMethod · 0.95
testTrainAccuracyMethod · 0.95
test1Method · 0.95
testBMethod · 0.95
testTrainAccuracyMethod · 0.95
testTrainPlusAdpatMethod · 0.95
testVectorEncodingBMethod · 0.95

Calls 1

reduceMethod · 0.95

Tested by 7

testBMethod · 0.76
testTrainAccuracyMethod · 0.76
test1Method · 0.76
testBMethod · 0.76
testTrainAccuracyMethod · 0.76
testTrainPlusAdpatMethod · 0.76
testVectorEncodingBMethod · 0.76