Artificial intelligence · lesson 1 of 4
Decision trees, splits and ensembles
A decision tree partitions feature space using a sequence of tests. Leaf predictions summarize the training examples reaching them.
Learn the ideas
Prerequisites: Classification and basic probability.
Tree model
A decision tree partitions feature space using a sequence of tests. Leaf predictions summarize the training examples reaching them.
Impurity
For class probabilities pj, Gini impurity is 1−sum pj². A split is evaluated using the sizes and impurity of its child groups.
Complexity
Deep trees can fit small idiosyncratic groups. Depth limits, minimum leaf sizes and pruning can control complexity.
Ensembles
Combining trees can reduce some errors, but correlated mistakes and data defects can remain. Ensemble size does not replace proper evaluation.
Worked examples
A binary node has class proportions 0.5 and 0.5. Find Gini impurity.
1−0.25−0.25=0.5.
0.5
A node contains only one class. Find its Gini impurity.
1−1²=0.
0
Check your understanding
8 questionsDecimals or fractions are accepted for numeric answers. Proofs and written responses use sample answers and require human marking. This is practice, not a protected examination.
Further reading and review references
These are reference links, not copied exercises, institutional endorsement or proof of independent review.