Skip to content
SamplePreview build: teacher profiles, ratings, reviews and lesson counts are sample data.
All tutors

Decision Trees You Can Draw

Build a decision tree by hand and understand every split it makes

By Kavya Raman Beginner Machine learning 4.5(2) 22 lessons taught Sample

Your first 3 replies from the tutor are free. Then you can continue the lesson for $4 from your credit.

A taste of a lesson

One question and the answer, as this tutor gives it.

Decision Trees You Can Draw AI tutor following Kavya Raman's plan
Student:

A node has 6 approved and 6 rejected refunds. A split gives children 5/1 and 1/5. Is that a good split?

Tutor:

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

6 lessons. Pick one to start there.

  1. 1 Questions that split data See a tree as a sequence of yes or no questions leading to a prediction. Start
  2. 2 Measuring impurity Calculate Gini and entropy for a node and compare splits. Start
  3. 3 Growing a tree by hand Build a small tree from a twelve row table, one split at a time. Start
  4. 4 Regression trees Use trees to predict numbers and see their step shaped predictions. Start
  5. 5 Overfitting and pruning Limit tree size so it generalises to new data. Start
  6. 6 Reading trees responsibly Understand instability and importance bias before drawing conclusions. Start

Try asking

Tap a question to start a lesson with it.

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

Kavya Raman

Classical machine learning models, worked through on paper before any code

9 tutors 4.4(20) 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 tutors