Decision Tree
Study guides: Exam SRM, Exam PA, ATPA, Exam MAS-II, Exam ACIA-CAPSTONE, FIE-M1
A Decision Tree is a statistical learning method that divides the predictor space into rectangular regions R_1, \ldots, R_J by a sequence of binary splits, and predicts the same value for every observation in a region. Each split tests one predictor against a cutoff, such as X_j < s, and divides one existing region into two. In a regression tree the prediction for region R_j is
\hat{y}_{R_j} = \frac{1}{n_j}\sum_{i \in R_j} y_i
n_jis the number of training observations inR_j.
An observation is predicted by following its predictor values down the splits until it reaches a terminal node, or leaf. Observations in the same leaf get the same prediction.
A tree first splits on driver age
< 25, and for older drivers on vehicle age< 5. The training severities in the leaf for drivers 25 or older with vehicles 5 years or older are 4, 6 and 8 (in\$000). What does the tree predict for a 40-year-old driver with an 8-year-old vehicle?
- The driver is not under 25, so the observation goes to the right branch.
- The vehicle is not under 5 years old, so it lands in that leaf.
- The prediction is the leaf's mean,
(4 + 6 + 8)/3 = 6, or\$6{,}000.
Recursive binary splitting
The regions are chosen to make the residual sum of squares small:
\text{RSS} = \sum_{j=1}^{J}\sum_{i \in R_j}\left(y_i - \hat{y}_{R_j}\right)^2
The tree is grown by recursive binary splitting, which is greedy and top-down. At each step it makes the split that reduces the RSS most at that step, with no look-ahead. Grown until a stopping rule such as a minimum node size, the tree fits the training data closely, so it can be overly complex and predict poorly on test data. A large tree is cut back by pruning.
The responses at
x = 1, \ldots, 6are2, 3, 4, 9, 11, 13. Which cutoff does the first split use,x < 2.5orx < 3.5?
x < 2.5gives\{2, 3\}and\{4, 9, 11, 13\}, with RSS0.5 + 44.75 = 45.25.x < 3.5gives\{2, 3, 4\}and\{9, 11, 13\}, with RSS2 + 8 = 10.- The tree splits at
x < 3.5.
Classification trees
A classification tree predicts the most common class among the training observations in a region. Its splits are chosen by a node impurity measure, the Gini index or the entropy, in place of the RSS.
Advantages and disadvantages
Advantages:
- Trees are very easy to explain, even easier than linear regression. Their splits form simple if-then rules that can be followed directly.
- Some believe they mirror human decision-making more closely than other regression and classification methods do.
- They can be displayed graphically and are easily interpreted even by a non-expert, especially when small.
- They handle qualitative predictors without dummy variables.
Disadvantages:
- They generally predict less accurately than other regression and classification approaches.
- They are non-robust: they have high variance, so a small change in the data can cause a large change in the final tree.
Tree ensembles, such as bagging, random forests and boosting, combine many trees to reduce this variance.
Splits are axis-parallel Each split uses one predictor, so every boundary between regions is a vertical or horizontal line in the predictor space. A class pattern divided by a diagonal line can only be approximated by a staircase of splits.
Practice questions
- Exam ATPA Practice Question 29
- CAS Exam MAS-II Fall 2018, Question 38
- CAS Exam MAS-II Fall 2018, Question 40
- CAS Exam MAS-II Fall 2019, Question 38
- CAS Exam MAS-II Spring 2019, Question 39
- Exam MAS-II Practice Question 11
- SOA Exam SRM Sample Question 9
- SOA Exam SRM Sample Question 25
- SOA Exam SRM Sample Question 26
- SOA Exam SRM Sample Question 29
- SOA Exam SRM Sample Question 33
- SOA Exam SRM Sample Question 39
- SOA Exam SRM Sample Question 48
- SOA Exam SRM Sample Question 51
- SOA Exam SRM Sample Question 57
- SOA Exam SRM Sample Question 63
- SOA Exam SRM Sample Question 66