Data structures and methods for learning decision trees.
node(test=None, examples=None, information=None, level=None, parent=None, pos=None)¶
A node in a tree.
- expandQueue – Breadth first search node expansion strategy
- depth – initial depth is 0 because no node present
- maxDepth – max depth set to 1 because we want to at least learn a tree of depth 1
- learnedDecisionTree – this will hold all the clauses learned
- data – stores all the facts, positive and negative examples
Expand the node based on the best test.
getTrueExamples(clause, test, data)¶
Returns all examples that satisfy the clause with conjoined test literal.
Create the root node of the tree.
Method to create and learn the decision tree.
Set the maximum depth of the tree.