โšกFREE Live Master Session: Code Your AI Companion for Kids

    Register for Free โ†’
    AI & ML WorksheetsBuild Your First Classifier
    Free Interactive Worksheet ยท Beginner

    Build Your First ClassifierClassification & Decision Trees

    Understand how Machine Learning models sort items into categories. Build a step-by-step decision tree flowchart!

    ๐Ÿ‘‹

    Build Your First Classifier

    Sorting things into categories

    A classifier is an AI model that sorts input data into distinct categories (classes). Instead of predicting a continuous number, a classifier answers: "Which group does this item belong to?"

    ๐Ÿ’ก Interactive Classifier Demonstration (Input โž” Classifier โž” Category)

    Click any example below to see how a classifier categorizes it:

    Input: Email: 'Win $1,000,000 NOW! Click link!'โž”๐Ÿšจ SPAM

    Type: Binary Classifier. Correct! A classifier takes measurable inputs and sorts them into target categories.

    ๐Ÿ—‚๏ธ

    Classification Types

    Binary vs Multi-class

    Binary Classification

    Exactly 2 possible output categories (e.g. Yes/No, Spam/Safe, Pass/Fail).

    Multi-class Classification

    3 or more output categories (e.g. Cat vs Dog vs Bird vs Fish).

    Key Distinction: Classifiers output category labels (like 'Dog' or 'Cat'). If a model predicts a numerical measurement (like house price ยฃ250,000), that is called Regression!

    ๐ŸŽฏ Interactive Activity: Classify as Binary or Multi-class

    Select the correct classification type for each task below:

    "Is this email spam or not spam?"

    "Which animal is this? (Cat, Dog, or Bird)"

    "Is the patient healthy or sick?"

    "Which grade did student receive? (A, B, C, D, or F)"

    ๐ŸŒณ

    Decision Trees

    Flowchart Decision Logic

    A Decision Tree is a popular classifier that functions like a step-by-step flowchart of Yes/No questions:

    1. Root / Internal Node

    A question testing a feature (e.g. "Does it have wings?").

    2. Branch

    The path followed based on the answer (YES or NO).

    3. Leaf Node

    The final predicted class category (e.g. "Bird").

    ๐ŸŒฟ Interactive Decision Tree: Follow the Branch

    Answer the questions below to trace the decision tree path to a final prediction:

    Root Node Question 1

    Does the animal have wings?

    ๐ŸŽฎ

    Playground: Decision Tree Builder

    Sort Animals into Birds vs Mammals

    Build a decision tree step-by-step to classify animals (Eagle, Penguin, Dolphin, Dog) into Bird vs Mammal:

    Target Dataset:

    EagleWings: Y | Water: NBird
    PenguinWings: Y | Water: YBird
    DolphinWings: N | Water: YMammal
    DogWings: N | Water: NMammal
    ๐Ÿ’ช

    Interactive Exercises

    Total XP Earned: 0 / 90 XP
    0 / 4 Completed
    1

    Exercise 1: Classification vs Regression

    +15 XP ยท Beginner
    2

    Exercise 2: Tree Nodes

    +20 XP ยท Beginner
    3

    Exercise 3: Binary or Multi-class?

    +25 XP ยท Intermediate
    4

    Exercise 4: Decision Logic

    +30 XP ยท Intermediate
    ๐Ÿง 

    Knowledge Check

    Ready to test your knowledge?

    Answer 10 multiple-choice questions to test your understanding of classifiers and decision trees!

    ๐Ÿš€ Ready for live coding?

    Build Real Machine Learning Models with Tutors

    Take the next step! Join our live Intro to Machine Learning Course and write real Python ML code with expert 1-on-1 guidance.