WhizzStep โ† Back to all Labs
๐Ÿ”ฌ AI Lab ยท Classes 7-9
๐Ÿ”ฌ Interactive Simulation #2

๐ŸŒณ 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.

1
Pick Questions
2
Build Your Tree
3
Test on Animals
4
Complete the Lab

๐Ÿง  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.

๐ŸŒฑ 1. Build Tree
๐Ÿ”ฎ 2. Test Animals
๐Ÿ… 3. Badge
๐ŸŒฑ Phase 1 โ€” Build Your Decision Tree
Pick 3 yes/no questions in order to build a tree that classifies 8 animals.
๐Ÿค–

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!

๐Ÿ’ก Tip: The best first question splits animals into two equal groups!

๐ŸŒณ 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.

๐Ÿ”ฎ Phase 2 โ€” Test Your Tree!
Walk your decision tree through mystery animals and see if it classifies them correctly!
๐Ÿค–

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!

โ“
Click to reveal!
Click to shuffle animal

๐Ÿ” Tree Walk โ€” Step by Step

๐ŸŒณ

Select an animal and click "Walk My Tree!"

๐Ÿ† Your Tree's Performance

0

โœ… Correct

0

โŒ Wrong

0

๐Ÿ”ฎ Tested

โ€”

๐Ÿ“ˆ Accuracy

๐Ÿ…

WhizzStep Decision Detective Badge

Activity completion card for

Young AI Detective

successfully built and tested a Decision Tree Classifier

This records completion of a browser activity only. It is not an accredited certificate or proof of mastery.

Questions used: โ€”  |  Animals classified: โ€”  |  Accuracy: โ€”

๐ŸŒณ You just built what doctors, engineers and scientists use every day โ€”
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

AI-02 How AI and Machine Learning Work Classes 7-9 15 min Foundation

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?

โ† Fruit Classifier Back to All Labs Fair AI or Biased AI? โ†’
Bring this learning to my school โ†’