Exercises
Explore how decision trees and tree-based ensembles learn from data. This quiz covers split criteria, tree complexity, pruning, bagging, random forests, out-of-bag evaluation, AdaBoost, gradient boosting, learning rates, early stopping, and feature importance. Questions range from foundational concepts to practical interpretation of tree diagrams and ensemble behavior.
Answer the questions below and check the explanation for each answer.
0/15 answered
Auto audio on: the next questions will be read aloud when you click Continue.
A pure node has a Gini impurity of 0 because there is no uncertainty about the class of an observation selected from that node.
A deeper tree can fit more complex patterns, reducing training bias. It also becomes more sensitive to training noise, which increases variance and the risk of overfitting.
Information gain is the parent node's entropy minus the weighted average entropy of its children. A larger value indicates a greater reduction in uncertainty.
Because x1 = 4 satisfies x1 ≤ 5, the sample moves left. It then fails x2 ≤ 2 because 3 is greater than 2, so it reaches L2.
Bagging averages predictions from models trained on bootstrap samples. Averaging stabilizes their predictions and reduces variance, especially when the individual errors are not perfectly correlated.
Like bagging, random forests use bootstrap samples. They also consider a random subset of features at each split, which decorrelates the trees and makes averaging more effective.
Random feature selection prevents one dominant predictor from controlling most trees. The resulting trees are less correlated, so their averaged prediction generally has lower variance.
The bootstrap draw contains records 1, 2, 2, 4, and 5. Record 3 was not selected, so it is out-of-bag and can help evaluate that tree.
Boosting is sequential: each new weak learner focuses on shortcomings of the current ensemble. Bagging generally trains models independently and combines their predictions.
Each new tree approximates the negative gradient of the loss with respect to current predictions. For squared-error regression, these values correspond to ordinary residuals.
A smaller learning rate shrinks each tree's contribution. More boosting iterations are therefore usually needed, but the slower learning process can improve generalization when properly tuned.
AdaBoost increases the relative influence of misclassified observations. The next weak learner is therefore encouraged to focus more strongly on difficult training examples.
Panel C has a highly irregular boundary that bends around isolated observations. This suggests that the tree is modeling training noise rather than only the broader class pattern.
Permuting Feature B causes the largest decrease in validation accuracy. The model therefore depends more strongly on Feature B than on the other displayed features.
Early stopping monitors performance on validation data and halts training when improvement stalls. This selects an effective number of trees and helps limit overfitting.

Free CourseDeep Learning With PyTorch
3h39m
19 exercises

Free CourseMachine Learning tutorial
10h20m
6 exercises

Free CourseGoogle Prompting Essentials
3h24m
10 exercises

Free CourseData Science
5h58m
38 exercises

Free CourseArtificial intelligence
12h40m
7 exercises

Free CourseFundamentals of Artificial Intelligence
25h26m
34 exercises

Free CourseR programming for Data Science
1h07m
6 exercises

Free CourseGoogle AI Essentials
3h40m
13 exercises
Thousands of online courses in video, ebooks and audiobooks.
To test your knowledge during online courses
Generated directly from your cell phone's photo gallery and sent to your email
Download our app via QR Code or the links below:.
+ 10 million
students
Free and Valid
Certificate
60 thousand free
exercises
4.8/5 rating in
app stores
Free courses in
video and ebooks