Package aima.test.core.unit.learning.inductive

Examples of aima.test.core.unit.learning.inductive.MockDLTestFactory


  @Test
  public void testDecisionListLearnerReturnsNegativeDLWhenDataSetEmpty()
      throws Exception {
    // tests first base case of DL Learner
    DecisionListLearner learner = new DecisionListLearner("Yes", "No",
        new MockDLTestFactory(null));
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    DataSet empty = ds.emptyDataSet();
    learner.train(empty);
    Assert.assertEquals("No", learner.predict(ds.getExample(0)));
    Assert.assertEquals("No", learner.predict(ds.getExample(1)));
View Full Code Here


  @Test
  public void testDecisionListLearnerReturnsFailureWhenTestsEmpty()
      throws Exception {
    // tests second base case of DL Learner
    DecisionListLearner learner = new DecisionListLearner("Yes", "No",
        new MockDLTestFactory(new ArrayList<DLTest>()));
    DataSet ds = DataSetFactory.getRestaurantDataSet();
    learner.train(ds);
    Assert.assertEquals(DecisionListLearner.FAILURE,
        learner.predict(ds.getExample(0)));
  }
View Full Code Here

TOP

Related Classes of aima.test.core.unit.learning.inductive.MockDLTestFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.