Package aima.core.learning.learners

Examples of aima.core.learning.learners.DecisionListLearner.predict()


    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)));
    Assert.assertEquals("No", learner.predict(ds.getExample(2)));
  }

  @Test
View Full Code Here


        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)));
    Assert.assertEquals("No", learner.predict(ds.getExample(2)));
  }

  @Test
  public void testDecisionListLearnerReturnsFailureWhenTestsEmpty()
View Full Code Here

    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)));
    Assert.assertEquals("No", learner.predict(ds.getExample(2)));
  }

  @Test
  public void testDecisionListLearnerReturnsFailureWhenTestsEmpty()
      throws Exception {
View Full Code Here

    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)));
  }

  @Test
  public void testDecisionListTestRunOnRestaurantDataSet() throws Exception {
    DataSet ds = DataSetFactory.getRestaurantDataSet();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.