@Test public void testMeasure() { System.out.println("F-measure"); int[] truth = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; int[] prediction = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; FMeasure instance = new FMeasure(); double expResult = 0.87719; double result = instance.measure(truth, prediction); assertEquals(expResult, result, 1E-5); }
@Override public double measure(int[] truth, int[] prediction) { return of(beta, truth, prediction); }
FMeasure implements ClassificationMeasure { @Override public double measure(int[] truth, int[] prediction) { return of(beta, truth, prediction); } }
FMeasure implements ClassificationMeasure { @Override public double measure(int[] truth, int[] prediction) { return of(beta, truth, prediction); } FMeasure();  FMeasure(double beta); }
FMeasure implements ClassificationMeasure { @Override public double measure(int[] truth, int[] prediction) { return of(beta, truth, prediction); } FMeasure();  FMeasure(double beta); @Override double measure(int[] truth, int[] prediction); static double of(double beta, int[] truth, int[] prediction); }
FMeasure implements ClassificationMeasure { @Override public double measure(int[] truth, int[] prediction) { return of(beta, truth, prediction); } FMeasure();  FMeasure(double beta); @Override double measure(int[] truth, int[] prediction); static double of(double beta, int[] truth, int[] prediction);  }