Exploring a decision tree from the root to the leaves
A decision tree is a tree-like graph, that is, a sequential diagram illustrating all of the possible decision alternatives and their corresponding outcomes. Starting from the root of a tree, every internal node represents the basis on which a decision is made. Each branch of a node represents how a choice may lead to the next nodes. And, finally, each terminal node, the leaf, represents the outcome produced.
For example, we have just made a couple of decisions that brought us to the point of using a decision tree to solve our advertising problem:
Figure 4.2: Using a decision tree to find the right algorithm
The first condition, or the root, is whether the feature type is numerical or categorical. Ad clickstream data contains mostly categorical features, so it goes to the right branch. In the next node, our work needs to be interpretable by non-technical clients. So, it goes...