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

decisionListLearning() private method

private decisionListLearning ( DataSet ds ) : DecisionList
ds AIMA.Core.Learning.Framework.DataSet
return AIMA.Core.Learning.Inductive.DecisionList
        private DecisionList decisionListLearning(DataSet ds)
        {
            if (ds.size() == 0)
            {
                return new DecisionList(positive, negative);
            }
            List<DLTest> possibleTests = testFactory
                    .createDLTestsWithAttributeCount(ds, 1);
            DLTest test = getValidTest(possibleTests, ds);
            if (test == null)
            {
                return new DecisionList(null, FAILURE);
            }
            // at this point there is a test that classifies some subset of examples
            // with the same target value
            DataSet matched = test.matchedExamples(ds);
            DecisionList list = new DecisionList(positive, negative);
            list.add(test, matched.getExample(0).targetValue());
            return list.mergeWith(decisionListLearning(test.unmatchedExamples(ds)));
        }