package org.apache.samoa;

/*
 * #%L
 * SAMOA
 * %%
 * Copyright (C) 2014 - 2015 Apache Software Foundation
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import org.apache.samoa.LocalDoTask;
import org.junit.Test;

public class AlgosTest {

  @Test
  public void testVHTLocal() throws Exception {

    TestParams vhtConfig = new TestParams.Builder()
        .inputInstances(200_000)
        .samplingSize(20_000)
        .evaluationInstances(200_000)
        .classifiedInstances(200_000)
        .classificationsCorrect(75f)
        .kappaStat(0f)
        .kappaTempStat(0f)
        .cliStringTemplate(TestParams.Templates.PREQEVAL_VHT_RANDOMTREE)
        .resultFilePollTimeout(10)
        .prePollWait(10)
        .taskClassName(LocalDoTask.class.getName())
        .build();
    TestUtils.test(vhtConfig);

  }

  @Test
  public void testBaggingLocal() throws Exception {
    TestParams baggingConfig = new TestParams.Builder()
        .inputInstances(200_000)
        .samplingSize(20_000)
        .evaluationInstances(180_000)
        .classifiedInstances(210_000)
        .classificationsCorrect(60f)
        .kappaStat(0f)
        .kappaTempStat(0f)
        .cliStringTemplate(TestParams.Templates.PREQEVAL_BAGGING_RANDOMTREE)
        .prePollWait(10)
        .resultFilePollTimeout(10)
        .taskClassName(LocalDoTask.class.getName())
        .build();
    TestUtils.test(baggingConfig);

  }

  @Test
  public void testNaiveBayesLocal() throws Exception {

    TestParams vhtConfig = new TestParams.Builder()
        .inputInstances(200_000)
        .samplingSize(20_000)
        .evaluationInstances(200_000)
        .classifiedInstances(200_000)
        .classificationsCorrect(65f)
        .kappaStat(0f)
        .kappaTempStat(0f)
        .cliStringTemplate(TestParams.Templates.PREQEVAL_NAIVEBAYES_HYPERPLANE)
        .resultFilePollTimeout(10)
        .prePollWait(10)
        .taskClassName(LocalDoTask.class.getName())
        .build();
    TestUtils.test(vhtConfig);

  }

}

@@ -812,33 +812,32 @@
 ows Exception %7B%0A
-%0A
     TestParams v
@@ -1324,33 +1324,32 @@
 est(vhtConfig);%0A
-%0A
   %7D%0A%0A  @Test%0A  p
@@ -1549,10 +1549,10 @@
 ces(
-18
+20
 0_00
@@ -1584,17 +1584,17 @@
 tances(2
-1
+0
 0_000)%0A 
@@ -1917,25 +1917,24 @@
 ingConfig);%0A
-%0A
   %7D%0A%0A  @Test
@@ -1989,17 +1989,16 @@
 ption %7B%0A
-%0A
     Test
@@ -2508,16 +2508,14 @@
 onfig);%0A
-%0A
   %7D%0A
-%0A
 %7D%0A

Fix flawed bagging test