Learning from examples / 3 of 7
Decision trees
What you’ll learn
- Explain the main idea of “Decision trees” in your own words.
- Trace a concrete example and identify the assumptions behind it.
- Apply the principle in a practice problem and recognize a common failure.
The idea, intuitively
A decision tree repeatedly asks questions about features and routes an example to a leaf prediction. The resulting rules are often readable, but a very large tree can memorize training noise.
Think of the dataset as a sample from a larger environment. A useful model must transfer beyond that sample. Keep training choices separate from final evaluation, and compare against a simple baseline. Before selecting an algorithm, inspect what the labels mean and which errors matter to the user.
Under the hood
A split is selected to reduce impurity or numeric error. Depth limits and minimum leaf size restrict complexity. Trees can model nonlinear interactions without requiring globally linear relationships.
Feature importance is not evidence that changing a feature causes the prediction outcome.
A worked example
A support router might split first on product type, then on error severity. A leaf estimates a category from its training examples.
How to use this way of thinking
Define the target, split the data, fit preprocessing only on training examples, and evaluate a baseline. Inspect individual failures alongside aggregate metrics. Change one major choice at a time and use validation evidence to decide whether the additional complexity earns its place.
Try it yourself
A leaf has 8 positive and 2 negative examples. Estimate its positive probability.
Key takeaways
- A minimum number of samples per leaf
- Feature importance is not evidence that changing a feature causes the prediction outcome.
- Check the assumptions with a small example before applying this idea to a larger system.
Check your understanding
Use feedback to learn. Quiz scores and lesson completion are tracked separately.
Go to lesson completionFurther reading
Original papers and reference material for this school. External resources may be in English and require internet access.
Google Machine Learning Crash Course (opens a new tab)scikit-learn user guide (opens a new tab)Finish this lesson
Mark this lesson complete when you’re ready to continue.