๐ณ Decision Tree Detective
Build a step-by-step question tree to classify animals โ exactly how AI makes decisions! You're the detective, the AI is your apprentice.
๐ง What is a Decision Tree?
Ask Yes/No Questions
A decision tree works by asking a series of yes or no questions. Each answer leads you down a different path.
Branch by Branch
Like a real tree, it starts at the root (first question) and branches out until it reaches a leaf (final answer).
AI Uses This!
Many real AI systems โ like spam filters and medical diagnosis tools โ use decision trees to make fast, explainable decisions.
Order Matters!
The best first question splits animals most evenly. Choosing the right order is the key skill in building smart trees.
Wizzy says:
Here's a challenge โ I'm thinking of one of 8 animals: ๐ฆ Lion, ๐ Elephant, ๐ง Penguin, ๐ฆ Butterfly, ๐ Fish, ๐ฆ Eagle, ๐ Crocodile, ๐ฌ Dolphin. Can you build a yes/no question tree to figure out which animal it is? Pick your 3 best questions from the bank below!
โ Question Bank
Click a question to add it to your tree. Pick 3 questions wisely!
๐ณ Your Decision Tree
Your tree will appear here as you add questions.
Add your first question to grow the tree!
๐ Why does question order matter?
Information Gain
Real AI picks the question that reduces uncertainty the most. This is called "Information Gain" โ the smarter the split, the better the tree.
Depth = Complexity
A tree with fewer questions (less depth) is simpler and faster. AI engineers always try to build the shallowest tree that still works correctly.
Used in Medicine!
Doctors use decision trees to diagnose illness. "Does the patient have a fever? โ Yes โ Do they have a rash? โ ..." โ same logic, life-saving stakes.
Wizzy says:
Time to put your tree to the test! ๐ฏ I'll show you an animal. Your tree will walk through its questions one by one and make a prediction. Watch the path light up โ every YES goes left, every NO goes right! Let's see how smart your tree is!
๐ฆ Mystery Animal
Click the animal to shuffle. Watch the tree walk through the questions!
๐ Tree Walk โ Step by Step
Select an animal and click "Walk My Tree!"
๐ Your Tree's Performance
โ Correct
โ Wrong
๐ฎ Tested
๐ Accuracy
WhizzStep Decision Detective Badge
Activity completion card for
successfully built and tested a Decision Tree Classifier
Questions used: โ | Animals classified: โ | Accuracy: โ
a Decision Tree AI model. Welcome to the world of Explainable AI!
Wizzy says:
๐ Fantastic detective work! You just built an Explainable AI โ one where you can trace exactly WHY it made a decision. This is super important in real life โ doctors and judges need AI that can explain its reasoning, not just give an answer. The best AI is transparent AI! ๐ณ
๐ Decision Trees in the Real World
Bank Loans
Banks use decision trees to decide whether to approve loans. "Does the person have a job? โ Do they have savings? โ What's their credit score?" โ fast and auditable.
Medical Diagnosis
AI decision trees help doctors quickly screen patients for diseases like malaria or COVID based on symptoms โ saving time in rural clinics.
Spam Filters
Your email's spam filter is essentially a giant decision tree. "Does it contain 'WIN PRIZE'? โ Is the sender unknown? โ Does it have 100 exclamation marks?" ๐
Smart Farming
Indian farmers are using AI decision trees to decide when to water crops, apply fertiliser, or harvest โ based on weather, soil, and crop data.
About this lab
Learning objective: Build a decision tree by asking yes/no questions and see how a model splits data step by step.
What this simplifies: A small toy dataset is used to keep the tree readable; real decision trees handle far more features and data.
Privacy: No learner input leaves the device.
Teacher prompt: Ask the class why this simulation might mislead someone who takes it too literally.
Reflect: What is one thing this activity showed you that you did not expect?
โ Back to all Labs