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

addLeaf() public method

public addLeaf ( String attributeValue, String decision ) : void
attributeValue String
decision String
return void
        public virtual void addLeaf(String attributeValue, String decision)
        {
            if (nodes.ContainsKey(attributeValue))
            {
                nodes[attributeValue] = new ConstantDecisonTree(decision);
            }
            else
            {
                nodes.Add(attributeValue, new ConstantDecisonTree(decision));
            }
        }

Usage Example

Example #1
0
 public static DecisionTree getStumpFor(DataSet ds, String attributeName,
         String attributeValue, String returnValueIfMatched,
         List<String> unmatchedValues, String returnValueIfUnmatched)
 {
     DecisionTree dt = new DecisionTree(attributeName);
     dt.addLeaf(attributeValue, returnValueIfMatched);
     foreach (String unmatchedValue in unmatchedValues)
     {
         dt.addLeaf(unmatchedValue, returnValueIfUnmatched);
     }
     return dt;
 }
All Usage Examples Of AIMA.Core.Learning.Inductive.DecisionTree::addLeaf