Decision Trees You Can Draw
Build a decision tree by hand and understand every split it makes
A taste of a lesson
A node has 6 approved and 6 rejected refunds. A split gives children 5/1 and 1/5. Is that a good split?
Let us check with Gini. The parent is 6/6, so Gini = 1 - (0.25 + 0.25) = 0.5, the worst possible for two classes. Each child is 5/1, so Gini = 1 - ((5/6)^2 + (1/6)^2) = 1 - (0.694 + 0.028), about 0.28. Both children have 6 rows, so the weighted average is also 0.28. Impurity dropped from 0.5 to 0.28, a solid split. Your turn: what is the weighted Gini if the children were 6/2 and 0/4?
Written by the teacher as an example. In your lesson the tutor answers your own questions, and like any AI it can be wrong.
What you will be able to do
- Calculate Gini impurity and pick the best split by hand
- Read a fitted tree as a set of if then rules
- Control overfitting with depth, leaf size and pruning
- Explain why single trees are unstable
- Judge feature importance from trees with appropriate caution
Lesson plan
- 1 Questions that split data See a tree as a sequence of yes or no questions leading to a prediction. Start
- 2 Measuring impurity Calculate Gini and entropy for a node and compare splits. Start
- 3 Growing a tree by hand Build a small tree from a twelve row table, one split at a time. Start
- 4 Regression trees Use trees to predict numbers and see their step shaped predictions. Start
- 5 Overfitting and pruning Limit tree size so it generalises to new data. Start
- 6 Reading trees responsibly Understand instability and importance bias before drawing conclusions. Start
Try asking
About this tutor
A beginner friendly tutor that teaches decision trees by building one on paper from a dozen rows. You calculate impurity, choose the best split, and see why trees are so easy to explain and so easy to overfit. Lessons cover classification and regression trees, Gini and entropy, depth limits and pruning, the instability of single trees and the biases in their feature importance. You finish knowing how to read a tree, how to control its size, and why most practitioners move on to forests or boosting for accuracy while keeping single trees for explanation.
Reviews
4.5
2 ratingsSample
- Sofia L.Sample
Good on impurity and pruning. The point about trees changing shape after resampling surprised me. Wanted a bit more on regression trees.
- Olumide A.Sample
Building the tree on paper was slow at first but it made everything afterwards obvious. I now explain trees to my team the same way.
About the teacher
Classical machine learning models, worked through on paper before any code
9 tutors 379 lessons taught Sample
I teach the classical machine learning models: regression, trees, ensembles, nearest neighbours, support vector machines and naive Bayes. My background is in applied analytics, where I spent a lot of time explaining to colleagues why a model made a particular prediction, and that shaped how I teach. I like to start with a tiny dataset you can hold in your...
See Kavya's profile and tutorsMore like this
Other tutors on the same or nearby topics.