cloudsandai
Decision Tree Classification: An Interactive Lab
Explore how decision trees split data into interpretable rules, compare Gini impurity with entropy, and see how tree complexity shapes nonlinear decision regions.
Section A
Explore the dataset
Classify whether a student passes using study hours and practice tests. Passing depends on both features being high, creating a nonlinear corner-shaped region. Incomplete rows are ignored.
| Study hours | Practice tests | Outcome | Action |
|---|---|---|---|
16 complete observations
Section C
Decision regions
Unlike logistic regression’s straight boundary, a decision tree makes axis-aligned splits that form rectangular regions.
Section D
Learn the rules
Each root-to-leaf path becomes an interpretable IF–THEN rule.
IF Study hours ≤ 3.50 THEN predict fail (class 0) · 8 samples
IF Study hours > 3.50 AND Practice tests ≤ 3.50 THEN predict fail (class 0) · 4 samples
IF Study hours > 3.50 AND Practice tests > 3.50 THEN predict pass (class 1) · 4 samples
Evaluate the tree
Accuracy
100.0%
Precision
100.0%
Recall
100.0%
Leaves
3
Confusion matrix · rows are actual, columns are predicted
| Predicted fail | Predicted pass | |
|---|---|---|
| Actual fail | 12 | 0 |
| Actual pass | 0 | 4 |