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

Method argmax

src/com/winvector/opt/impl/HelperFns.java:16–25  ·  view source on GitHub ↗
(final double[] pred)

Source from the content-addressed store, hash-verified

14
15
16 public static int argmax(final double[] pred) {
17 int choice = 0;
18 final int n = pred.length;
19 for(int i=1;i<n;++i) {
20 if(pred[i]>pred[choice]) {
21 choice = i;
22 }
23 }
24 return choice;
25 }
26
27 public static boolean isGoodPrediction(final double[] pred, final ExampleRow ei) {
28 final int predi = argmax(pred);

Callers 3

scoreMethod · 0.95
mapMethod · 0.95
isGoodPredictionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected