AIMA.Core.Learning.Learners.DecisionListLearner.predict C# (CSharp) Method

predict() public method

public predict ( Example e ) : String
e AIMA.Core.Learning.Framework.Example
return String
        public String predict(Example e)
        {
            if (decisionList == null)
            {
                throw new ApplicationException(
                        "learner has not been trained with dataset yet!");
            }
            return decisionList.predict(e);
        }

Usage Example

Example #1
0
 public void testDecisionListLearnerReturnsNegativeDLWhenDataSetEmpty()
 {
     // 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.AreEqual("No", learner.predict(ds.getExample(0)));
     Assert.AreEqual("No", learner.predict(ds.getExample(1)));
     Assert.AreEqual("No", learner.predict(ds.getExample(2)));
 }
All Usage Examples Of AIMA.Core.Learning.Learners.DecisionListLearner::predict