public test ( |
||
ds | ||
Résultat | int[] |
public void testInducedDecisionTreeClassifiesRestaurantDataSetCorrectly() { DecisionTreeLearner learner = new DecisionTreeLearner( createInducedRestaurantDecisionTree(), "Unable to clasify"); int[] results = learner.test(DataSetFactory.getRestaurantDataSet()); Assert.AreEqual(12, results[0]); Assert.AreEqual(0, results[1]); }
public void testStumpPredictionForDataSet() { DataSet ds = DataSetFactory.getRestaurantDataSet(); List<String> unmatchedValues = new List<String>(); unmatchedValues.Add(NO); DecisionTree tree = DecisionTree.getStumpFor(ds, "hungry", YES, YES, unmatchedValues, "Unable to Classify"); DecisionTreeLearner learner = new DecisionTreeLearner(tree, "Unable to Classify"); int[] result = learner.test(ds); Assert.AreEqual(5, result[0]); Assert.AreEqual(7, result[1]); }
public void testInducedTreeClassifiesDataSetCorrectly() { DataSet ds = DataSetFactory.getRestaurantDataSet(); DecisionTreeLearner learner = new DecisionTreeLearner(); learner.train(ds); int[] result = learner.test(ds); Assert.AreEqual(12, result[0]); Assert.AreEqual(0, result[1]); }