Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 1.25 KB

Decision-Tree-Learning.md

File metadata and controls

18 lines (16 loc) · 1.25 KB

DECISION-TREE-LEARNING

AIMA3e

function DECISION-TREE-LEARNING(examples, attributes, parent_examples) returns a tree
if examples is empty then return PLURALITY-VALUE(parent_examples)
else if all examples have the same classification then return the classification
else if attributes is empty then return PLURALITY-VALUE(examples)
else
   A ← argmaxaattributes IMPORTANCE(a, examples)
   tree ← a new decision tree with root test A
   for each value vk of A do
     exs ← { e : eexamples and e.A = vk }
     subtree ← DECISION-TREE-LEARNING(exs, attributesA, examples)
     add a branch to tree with label (A = vk) and subtree subtree
   return tree


Figure ?? The decision-tree learning algorithm. The function IMPORTANCE is described in Section ??. The function PLURALITY-VALUE selects the most common output value among a set of examples, breaking ties randomly.