|
Algorithm 2 (construction of the tree ). |
|
Input: T (a nonempty decision table), (the directed acyclic graph for T), and k (a natural number between 1 to 5).
Output: A decision tree .
Check all nodes of the DAG whether there is a decision tree attached to each node. If yes, then return the tree attached to the node T as and break the algorithm. If not, select a node of the graph that does not have an attached tree. It can be either a leaf node of or an internal node of where all children are tagged with trees.
If is a leaf node, then attach to it the decision tree that have only a single node. This node is tagged with the decision attached to all rows of . Move to step 1.
-
If is not a leaf node, then do the following according to the value k:
When , construct the tree and attach it to as the tree .
When , construct the tree and attach it to as the tree .
When , construct the trees and , choose between them a tree with the minimum depth and attach it to as the tree .
When , construct the tree and attach it to as the tree .
When , construct the trees and , choose between them a tree with the minimum depth and attach it to as the tree .
Move to step 1.
|