|
Algorithm 1. |
Input: A nonempty decision table T and a number . Output: A decision tree of the type k for the table T.
Construct a tree G consisting of a single node labeled with T.
If no node of the tree G is labeled with a table, then the algorithm ends and returns the tree G.
Choose a node v in G, which is labeled with a subtable of the table T.
If is degenerate, then instead of , we label the node v with 0 if is empty and with the decision attached to each row of if is nonempty.
-
If is nondegenerate, then depending on k, we choose a query X (either attribute or hypothesis) in the following way:
-
(a)
If , then we find an attribute X with the minimum impurity .
-
(b)
If , then we find a hypothesis X over T with the minimum impurity .
-
(c)
If , then we find an attribute Y with the minimum impurity and a hypothesis Z over T with the minimum impurity . Between Y and Z, we choose a query X with the minimum impurity .
-
(d)
If , then we find a proper hypothesis X over T with the minimum impurity .
-
(e)
If , then we find an attribute Y with the minimum impurity and a proper hypothesis Z over T with the minimum impurity . Between Y and Z, we choose a query X with the minimum impurity .
Instead of , we label the node v with the query X. For each answer , we add to the tree G a node and an edge connecting v and . We label the node with the subtable and label the edge with the answer S. We then proceed to step 2.
|