Пример #1
0
 @Test
 public void testAUCShuffled() throws ApplicationException {
   boolean[] classes = {true, false, true, false, true, false, false};
   double[] scores = {9, 8, 7, 1, 5, 10, 3};
   AucRoc measure = new AucRoc("AUC-ROC");
   double auc = measure.computeResult(classes, scores);
   assertEquals(7d / 12, auc, 0.00001);
 }
Пример #2
0
  @Test
  public void test3() {
    boolean[] classes = {false, false, false, false, false, false, false, false, false, false};
    double[] scores = {1, 10, 9, 8, 7, 6, 5, 4, 3, 2};

    AucRoc measure = new AucRoc("AucRoc");
    double result = measure.computeResult(classes, scores);
    assertEquals(0.5, result, 0.0001);
  }
Пример #3
0
  @Test
  public void test1() {
    boolean[] classes = {false, true, false, true, true, true, false, true, false, false};
    double[] scores = {1, 10, 9, 8, 7, 6, 5, 4, 3, 2};

    // tested against Sara's calcAreaROC in matlab
    AucRoc measure = new AucRoc("AucROC");
    double result = measure.computeResult(classes, scores);
    assertEquals(0.8, result, 0.0001);
  }