What is a decision tree, and how does it use a chain of yes/no questions to decide the class of a new example? Use "go out to play or stay in" as your example?
Supervised learning, Decision trees
Level L1 Beginner. Length Short. Nature Th Theoretical.
What's being asked
Whether you can explain, in plain words, what a decision tree looks like and how a prediction is made, before any talk of impurity or information gain.
Key idea
A decision tree is a flowchart of yes/no questions about the features. You start at the top (the root), answer one question at a time, follow the matching branch, and stop at a leaf, which holds the predicted class. Training means choosing good questions from the labelled data.
Steps
- Picture the flowchart. Root question: "Is it raining?" If yes, the leaf says "stay in". If no, ask "Is the temperature above 30 degrees Celsius?" If yes, "stay in"; if no, "go out".
- Name the parts. Each question box is a node, each answer is a branch, and each final box is a leaf that carries the predicted class.
- Classify a new example. Today there is no rain and it is 25 degrees. Raining? No. Above 30? No. So the leaf says "go out".
- Say what training does. The algorithm looks at labelled days and picks the questions that best separate the "go out" days from the "stay in" days. How it measures "best" (Gini impurity or entropy) comes in later questions.
Common mistakes
- Thinking the tree stores every training example. It stores only the questions and the class at each leaf.
- Thinking a tree needs numbers only. Questions can be about categories too, such as "Is the sky cloudy?".
How long your answer should be
4–5 sentences, ideally with the small flowchart sketched.
Read this
Previous in Supervised learning: A model scores each student with a number (positive leans towards "will pass", negative towards "will fail"). Why does logistic regression pass through the sigmoid function , and what does the output mean? For example, what does become?
Next in Supervised learning: What is the difference between multiclass and multilabel classification? Can you give one everyday example of each?