KwickAcademy Artificial Intelligence · 6 min · free
Decision Trees
A decision tree asks yes or no questions from the root to a leaf. It learns the best splits from past data.
Follows the syllabus of: CBSE Class 10 Artificial Intelligence (417)
On screen in this lesson
What is a decision tree?
| A model that asks yes or no questions in order |
| Root node: the first question at the top |
| Branches: the paths for each answer |
| Leaf node: the final decision, no more questions |
Parts of our tree
| Part | In our tree |
|---|---|
| Root node | Is it raining? |
| Inner node | Homework done? |
| Leaf nodes | Stay home, Play, HW |
| Depth | 2 questions |
Data from past days
| Day weather | Homework | Played? |
|---|---|---|
| Rainy | done | No |
| Rainy | not done | No |
| Sunny | done | Yes |
| Sunny | not done | No |
| Cloudy | done | Yes |
| Cloudy | not done | No |
How a tree splits data
| Split: divide rows by one question |
| Try every feature as the question |
| Pure group: all rows have the same answer |
| Pick the split that makes the purest groups |
| Repeat on each group until pure |
Split on homework
| Homework | Rows | Answers |
|---|---|---|
| not done | 3 | No, No, No |
| done | 3 | No, Yes, Yes |
Split on weather
| Weather | Rows | Answers |
|---|---|---|
| Rainy | 2 | No, No |
| Sunny | 2 | Yes, No |
| Cloudy | 2 | Yes, No |
Quick answers
Why does the tree put homework at the root?
It makes a pure group: all 'not done' rows say No.
What is overfitting?
Memorising training data instead of learning the pattern.
KwickClips from this lesson
Short clips, one idea each. Good for revision the night before.
What does the root do?41 sec
What is a pure group?37 sec
Where do you start reading?38 sec
What is the catch with decision trees?39 secThe full lesson, in text
Hello students, welcome to Kwickprep. Before playing cricket after school, you ask yourself a few questions. Is it raining? Is my homework done? A decision tree lets a computer decide in exactly this way. Today we draw a tree, see how it splits data, read predictions from it, and weigh its strengths and weaknesses.
A decision tree is a model that makes a decision by asking questions, one after another. The root node is the first question, drawn at the top. Branches are the paths that come out of a question, one for each answer. A leaf node is the end of a path, where the final decision is written. It is called a tree because it branches out, though we draw it upside down.
Here is a decision tree for a simple choice, drawn as a flowchart. The root question is, is it raining? If yes, the leaf says stay home. If no, we ask the next question, is the homework done? If yes, we play cricket, and if no, we finish homework first.
Let us name every part of this tree. The root node is, is it raining? The inner node, a question in the middle, is, is the homework done? The leaf nodes are the final answers: stay home, play cricket, and finish homework first. The depth is the longest chain of questions, which here is two.
A computer does not get the tree from us; it learns the tree from data. Here are six past days. On a rainy day with homework done, the child did not play. On a rainy day with homework not done, no play. On a sunny day with homework done, the child played. On a sunny day with homework not done, no play. Cloudy with homework done meant play, and cloudy without homework meant no play.
Now, how does the tree choose its questions? A split means dividing the rows into groups using one question. The computer tries every feature as a possible question. A group is called pure when all its rows have the same answer. It picks the question whose groups are the purest. Then it repeats the same process inside each group, until the groups are pure or small enough.
Let us try splitting on homework first. The not done group has three rows, and all three say no, so it is pure. The done group has three rows, with one no and two yes, so it is mixed.
Now try splitting on weather instead. The rainy group has two rows, both no, so it is pure. The sunny group has one yes and one no, so it is mixed. The cloudy group is also mixed. Pause and predict: which split is better? Homework wins, because its pure group is bigger, holding three rows.
So the tree puts homework at the root. If homework is not done, the leaf predicts no play. The done group was mixed, so the tree splits it again, this time on weather. If it is rainy, the leaf predicts no. Otherwise, the leaf predicts yes, and now every leaf is pure.
To read a prediction, start at the root and follow the answers down to a leaf. A sunny day with homework done passes the homework check, is not rainy, and reaches yes. A rainy day with homework done passes homework but stops at rainy, so no. A cloudy day with homework not done stops at the very first question, so no.
Every model has good and bad sides, so let us compare. A tree is easy to explain, since anyone can follow its questions, but a very big tree becomes confusing. It handles both numbers and words, but it is unstable, since a small change in data can build a very different tree. It predicts fast, but it can overfit.
Overfitting is a word you must know. It means the model memorises the training data instead of learning the general pattern. A very deep tree can create a separate leaf for almost every row. Such a tree scores well on old data but fails on new data, like a student who memorised answers without understanding. We fix this by limiting the depth or cutting off weak branches, which is called pruning.
Decision trees are used where people need to see the reason behind a decision. A bank can check income and existing loans before approving a loan. A hospital can use symptoms to estimate a patient's risk level. A shop can predict whether a customer will buy again. Farmers can get advice on which crop suits their soil and rainfall.
Let us revise what we learned today. A decision tree asks questions, starting at the root and ending at a leaf. The computer learns these questions from past data. At each step, it picks the split that makes the purest groups. To read a prediction, follow the answers down to a leaf. Trees are easy to explain, but deep trees can overfit. Try drawing your own tree for choosing what to eat at the canteen.
Courses that teach this
| Course | Unit |
|---|---|
| CBSE Class 10 Artificial Intelligence (417) | Part B Unit 2: Advanced Concepts of Modelling in AI |
Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.
Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

