☂️ Decision Trees

Umbrella Decision Tree

Drag weather sliders, tune decision thresholds, and watch the tree re-draw live — learning exactly how decision trees make multi-factor decisions!

🌤️ Weather Lab
🌳 See the Tree
🎯 Tune Thresholds
📊 Test Accuracy
🏆 Badge

How Decision Trees Make Decisions

Ask Questions

At each node, the tree asks a yes/no question: "Is rain chance > 60%?" Split the data based on the answer.

🌿

Split the Data

Each split divides data into two groups. We want each group to be as "pure" as possible — all umbrella or all no-umbrella.

🍃

Reach a Leaf

Follow the branches until you reach a leaf node. The leaf gives the final prediction: carry or don't carry!

✂️

Pruning

Removing branches that don't improve accuracy. Simpler trees generalise better to new weather data!

☂️
Wizzy the AI Tutor
Welcome to the Weather Decision Lab! ☁️ Drag the sliders to set today's weather conditions. The decision tree will instantly tell you whether to carry an umbrella and show you exactly which conditions triggered the decision. Try different combinations!

Step 1 — Set Today's Weather

50%
Rain chance
60%
Humidity
50%
Cloud cover
25°C
Temperature
20
Wind km/h
Decision path through the tree:
☂️
Wizzy the AI Tutor
Here's the full decision tree! The highlighted path in blue shows which branches the current weather follows. Each diamond is a question — follow Yes or No until you reach a leaf. The tree depth is the number of questions it asks.

Step 2 — Full Decision Tree

🌳 Tree Info

Depth: 4 levels
Leaf nodes: 8 outcomes
Features used: 5
Current path:
Tree Legend:
🔵 Blue path = current weather route
☂️ Green leaf = carry umbrella
☀️ Gray leaf = no umbrella needed
Diamond = decision node
Circle = leaf node (answer)
☂️
Wizzy the AI Tutor
Now you control the decision thresholds! Move the sliders to change where the tree draws the line. Lower rain threshold = more conservative (carry umbrella often). Watch the accuracy score change as you tune — this is exactly what ML engineers do when optimising a model!

Step 3 — Tune Decision Thresholds

Accuracy

🎛️ Decision Thresholds

55%
65%
60%
30 km/h
Live accuracy on 20 test days
☂️
Wizzy the AI Tutor
Full accuracy report across 20 test weather days! 📊 Green rows = correct prediction, red = wrong. Can you spot a pattern in the mistakes? Often the model fails at borderline cases — days where rain chance is close to the threshold!

Step 4 — Full Test Report

Accuracy
Correct
Wrong
4
Tree Depth
Day🌧️ Rain💧 Humid☁️ Cloud💨 WindTruthPredicted
☂️
Wizzy the AI Tutor
🎊 You've mastered decision trees — one of the most interpretable and widely used ML algorithms! Weather apps, medical diagnosis, loan approval, fraud detection — they all use decision trees or their powerful cousin, Random Forests!
☂️

Decision Tree Expert Badge!

You built a weather decision tree and tuned its thresholds to maximise accuracy!

Optional. Stays on this device only — not sent to WhizzStep.

☂️ WhizzStep AI Lab
Activity completion card for
Student Name
has explored Decision Trees & Threshold Tuning
This records completion of a browser activity only. It is not an accredited certificate or proof of mastery.
Tree Builder
Threshold Tuner
Weather AI Expert
Accuracy: — · whizzstep.in

Key Concepts Mastered

Decision Node

❓ Ask a Question

Each internal node tests one feature: "Is rain > 55%?" Data is split into Yes and No branches.

Leaf Node

🍃 The Answer

Terminal nodes that give the final prediction. No more splitting — just the class label.

Gini Impurity

📊 Split Quality

Measures how mixed the classes are at a node. Lower Gini = purer split = better decision boundary.

Threshold

✂️ Where to Split

The value that divides continuous features. Rain > 55% is a threshold. Tuning thresholds is key to accuracy.

Overfitting

😵 Too Deep

A very deep tree memorises training data but fails on new data. Pruning and max-depth limits help.

Random Forest

🌲🌲🌲 Many Trees

Train 100 decision trees on random subsets. Their majority vote is much more accurate than any single tree!

About this lab

AI-12 How AI and Machine Learning Work Classes 6-8 10 min Foundation

Learning objective: Use a simple weather scenario to see how a decision tree chooses between outcomes based on conditions.

What this simplifies: The scenario is intentionally simple with few variables to keep the logic visible.

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?

← Cluster Explorer Back to All Labs Spam or Not? →
Bring this learning to my school →