Package aima.core.learning.learners

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


    DataSet ds2 = ds.emptyDataSet();
    Assert.assertEquals(0, ds2.size());

    learner.train(ds2);
    Assert.assertEquals("Unable To Classify",
        learner.predict(ds.getExample(0)));
  }

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


    ds2.add(ds.getExample(0));
    ds2.add(ds.getExample(2));
    ds2.add(ds.getExample(3));

    learner.train(ds2);
    Assert.assertEquals("Yes", learner.predict(ds.getExample(0)));
  }

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

    ds2.add(ds.getExample(2));
    ds2.add(ds.getExample(3));
    ds2.setSpecification(new MockDataSetSpecification("will_wait"));

    learner.train(ds2);
    Assert.assertEquals("Yes", learner.predict(ds.getExample(1)));
  }

  @Test
  public void testInducedTreeClassifiesDataSetCorrectly() 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.