Decision Trees
A decision tree makes a choice by asking a chain of yes or no questions, like the game of 20 questions. It is one of the easiest models to read and explain. In this lesson you learn how a tree picks its questions, and you grow one yourself.
New words
- Decision tree
- A model that asks yes or no questions one after another to decide.
- Root, branch, leaf
- The first question, a path after an answer, and a final answer box.
- Split
- A question that divides a group of rows into two smaller groups.
- Gini impurity
- A score of how mixed a group is. Zero means all the same.
- Overfitting
- Learning the training rows by heart, so new rows are predicted badly.
- Random forest
- Many different trees that vote, and the majority answer wins.
What you will learn
- How does a bank officer decide on a loan?
- What makes a question good?
- How do you measure "mixed" with Gini?
- How much does one question help?
- How does the tree choose the best question?
- A tree is just if and else
- Why do deep trees memorise?
- Try it: grow a loan tree
- Common mistakes
- Explain it to a friend
- Key takeaways
10 quiz questions at the end.
The full lesson, with interactive demos and the quiz, opens after you sign in with Google. It is free.