Beispiel #1
0
  @Test
  public void testTrainC_ClassificationDataSet() {
    System.out.println("trainC");
    for (boolean conc : new boolean[] {true, false}) {
      OneVSOne instance = new OneVSOne(new DCDs(), conc);

      ClassificationDataSet train = FixedProblems.getSimpleKClassLinear(1000, 7);
      ClassificationDataSet test = FixedProblems.getSimpleKClassLinear(100, 7);

      ClassificationModelEvaluation cme = new ClassificationModelEvaluation(instance, train);
      cme.evaluateTestSet(test);

      assertTrue(cme.getErrorRate() <= 0.001);
    }
  }
Beispiel #2
0
  @Test
  public void testTrainC_ClassificationDataSet_ExecutorService() {
    System.out.println("trainC");
    for (boolean conc : new boolean[] {true, false}) {
      OneVSOne instance = new OneVSOne(new DCDs(), conc);

      ClassificationDataSet train = FixedProblems.getSimpleKClassLinear(1000, 7);
      ClassificationDataSet test = FixedProblems.getSimpleKClassLinear(100, 7);

      ExecutorService ex = Executors.newFixedThreadPool(SystemInfo.LogicalCores);

      ClassificationModelEvaluation cme = new ClassificationModelEvaluation(instance, train, ex);
      cme.evaluateTestSet(test);

      assertTrue(cme.getErrorRate() <= 0.001);
    }
  }