AIMA.Core.Learning.Inductive.DecisionTree.getStumpsFor C# (CSharp) Method

getStumpsFor() public static method

public static getStumpsFor ( DataSet ds, String returnValueIfMatched, String returnValueIfUnmatched ) : List
ds AIMA.Core.Learning.Framework.DataSet
returnValueIfMatched String
returnValueIfUnmatched String
return List
        public static List<DecisionTree> getStumpsFor(DataSet ds,
                String returnValueIfMatched, String returnValueIfUnmatched)
        {
            List<String> attributes = ds.getNonTargetAttributes();
            List<DecisionTree> trees = new List<DecisionTree>();
            foreach (String attribute in attributes)
            {
                List<String> values = ds.getPossibleAttributeValues(attribute);
                foreach (String value in values)
                {
                    List<String> unmatchedValues = Util.removeFrom(ds
                            .getPossibleAttributeValues(attribute), value);

                    DecisionTree tree = getStumpFor(ds, attribute, value,
                            returnValueIfMatched, unmatchedValues,
                            returnValueIfUnmatched);
                    trees.Add(tree);

                }
            }
            return trees;
        }