Decision Tree (Deprecated)
Synopsis
Generates a Decision Tree for classification of both nominal and numerical data.
Description
A decision tree is a tree-like graph or model. It is more like an inverted tree because it has its root at the top and it grows downwards. This representation of the data has the advantage compared with other approaches of being meaningful and easy to interpret. The goal is to create a classification model that predicts the value of atarget attribute(often calledclassorlabel)基于几个输入属性的例子Set. In RapidMiner an attribute withlabel罗依le is predicted by the Decision Tree operator. Each interior node of tree corresponds to one of the input attributes. The number of edges of a nominal interior node is equal to the number of possible values of the corresponding input attribute. Outgoing edges of numerical attributes are labeled with disjoint ranges. Each leaf node represents a value of thelabelattribute given the values of the input attributes represented by the path from the root to the leaf. This description can be easily understood by studying the attached Example Process.
Decision Trees are generated by recursive partitioning. Recursive partitioning means repeatedly splitting on the values of attributes. In every recursion the algorithm follows the following steps:
- An attributeAis selected to split on. Making a good choice of attributes to split on each stage is crucial to generation of a useful tree. The attribute is selected depending upon a selection criterion which can be selected by thecriterionparameter.
- Examples in the ExampleSet are sorted into subsets, one for each value of the attributeAin case of a nominal attribute. In case of numerical attributes, subsets are formed for disjoint ranges of attribute values.
- A tree is returned with one edge or branch for each subset. Each branch has a descendant subtree or alabelvalue produced by applying the same algorithm recursively.
In general, the recursion stops when all the examples or instances have the samelabelvalue, i.e. the subset is pure. Or recursion may stop if most of the examples are of the samelabelvalue. This is a generalization of the first approach; with some error threshold. However there are other halting conditions such as:
- There are less than a certain number of instances or examples in the current subtree. This can be adjusted by using theminimal size for splitparameter.
- No attribute reaches a certain threshold. This can be adjusted by using theminimum gainparameter.
- The maximal depth is reached. This can be adjusted by using themaximal depthparameter.
Pruning is a technique in which leaf nodes that do not add to the discriminative power of the decision tree are removed. This is done to convert an over-specific or over-fitted tree to a more general form in order to enhance its predictive power on unseen datasets. Pre-pruning is a type of pruning performed parallel to the tree creation process. Post-pruning, on the other hand, is done after the tree creation process is complete.
Differentiation
CHAID
The CHAID operator works exactly like the Decision Tree operator with one exception: it uses a chi-squared based criterion instead of the information gain or gain ratio criteria. Moreover this operator cannot be applied on ExampleSets with numerical attributes.
Input
training set
This input port expects an ExampleSet. It is the output of the Retrieve operator in the attached Example Process. The output of other operators can also be used as input.
Output
model
The Decision Tree is delivered from this output port. This classification model can now be applied on unseen data sets for the prediction of thelabelattribute.
example set
The ExampleSet that was given as input is passed without changing to the output through this port. This is usually used to reuse the same ExampleSet in further operators or to view the ExampleSet in the Results Workspace.
Parameters
Criterion
Selects the criterion on which attributes will be selected for splitting. It can have one of the following values:
- information_gain: The entropy of all the attributes is calculated. The attribute with minimum entropy is selected for split. This method has a bias towards selecting attributes with a large number of values.
- gain_ratio: It is a variant of information gain. It adjusts the information gain for each attribute to allow the breadth and uniformity of the attribute values.
- gini_index: This is a measure of impurity of an ExampleSet. Splitting on a chosen attribute gives a reduction in the average gini index of the resulting subsets.
- 精度: Such an attribute is selected for split that maximizes the accuracy of the whole Tree.
Minimal size for split
The size of a node is the number of examples in its subset. The size of the root node is equal to the total number of examples in the ExampleSet. Only those nodes are split whose size is greater than or equal to theminimal size for splitparameter.
Minimal leaf size
The size of a leaf node is the number of examples in its subset. The tree is generated in such a way that every leaf node subset has at least theminimal leaf sizenumber of instances.
Minimal gain
The gain of a node is calculated before splitting it. The node is split if its Gain is greater than theminimal gain. Higher value of minimal gain results in fewer splits and thus a smaller tree. A too high value will completely prevent splitting and a tree with a single node is generated.
Maximal depth
The depth of a tree varies depending upon size and nature of the ExampleSet. This parameter is used to restrict the size of the Decision Tree. The tree generation process is not continued when the tree depth is equal to themaximal depth. If its value is set to '-1', themaximal depthparameter puts no bound on the depth of the tree, a tree of maximum depth is generated. If its value is set to '1', a Tree with a single node is generated.
Confidence
This parameter specifies the confidence level used for the pessimistic error calculation of pruning.
Number of prepruning alternatives
As prepruning runs parallel to the tree generation process, it may prevent splitting at certain nodes when splitting at that node does not add to the discriminative power of the entire tree. In such a case alternative nodes are tried for splitting. This parameter adjusts the number of alternative nodes tried for splitting when split is prevented by prepruning at a certain node.
No prepruning
By default the Decision Tree is generated with prepruning. Setting this parameter to true disables the prepruning and delivers a tree without any prepruning.
No pruning
By default the Decision Tree is generated with pruning. Setting this parameter to true disables the pruning and delivers an unpruned Tree.