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

    Register for Free โ†’
    AI & ML WorksheetsTraining vs Testing Data
    Free Interactive Worksheet ยท Beginner

    Training vs Testing DataHonest Evaluation & Overfitting

    Discover why we split datasets, explore the dangers of overfitting, and see how testing on unseen data proves real-world performance!

    ๐Ÿ‘‹

    Training vs Testing Data

    Don't cheat on the exam!

    When building an AI model, we never test it on the exact same data we used to train it. That would be like memorizing practice exam questions beforehand โ€” it doesn't prove you actually learned the subject!

    Dataset Splitting Pipeline

    ๐Ÿ“ Full Dataset (100%)
    โž”
    ๐Ÿ“š Training Data (80%)
    Model learns patterns from this
    ๐Ÿงช Testing Data (20%)
    Unseen check of real ability

    Beginner Explanation: Training Data is what the model learns from. Testing Data contains hidden, unseen examples used to check how well the model works in the real world!

    ๐Ÿ”ช

    Why Split Data?

    Honest Evaluation & The Student Analogy

    The Student Exam Analogy

    If a student gets the exact exam questions 2 weeks before the test, they might score 100% simply by memorizing answers. But when given a brand-new test, they fail! Similarly, testing an AI model on its training data gives a false high score.

    The test set acts as an honest final exam on unseen data. Standard practice is to split data into 80% training and 20% testing.

    โ“ Quick Question: Should we test an AI model using the same examples it trained on?

    โš ๏ธ

    Overfitting & Underfitting

    Finding the Sweet Spot

    ๐Ÿšจ Overfitting

    The model memorizes training noise instead of learning general rules. It gets 99% in training, but fails on new test data!

    ๐Ÿ“‰ Underfitting

    The model is too simple to learn basic patterns. It scores poorly on both training (55%) and testing (55%).

    ๐Ÿ“Š Interactive Activity: Which Model Generalizes Better?

    Compare the training vs testing accuracy of both models below:

    ๐ŸŽฎ

    Playground: Dataset Splitter

    Visualizing Splits & Overfitting

    Adjust the percentage slider to split a fixed 20-item dataset into Training vs Testing data:

    Training: 80% (16 items)Testing: 20% (4 items)
    20% Train50% (Balanced)80% (Standard)95% Train

    ๐Ÿ“š Training Data (16 items)80%

    ๐Ÿงช Testing Data (4 items)20%

    โœ… Standard 80/20 Split (16 train / 4 test): The industry standard! Provides plenty of data for training while reserving a reliable test sample.
    SIMULATION

    Model Evaluation Simulation

    ๐Ÿ’ช

    Interactive Exercises

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

    Exercise 1: Spot the Overfitting

    +15 XP ยท Beginner
    2

    Exercise 2: Ideal Split

    +20 XP ยท Beginner
    3

    Exercise 3: Underfitting Signs

    +25 XP ยท Intermediate
    4

    Exercise 4: The Validation Set

    +30 XP ยท Intermediate
    ๐Ÿง 

    Knowledge Check

    Ready to test your knowledge?

    Answer 10 multiple-choice questions to test your understanding of training, testing, and overfitting!

    ๐Ÿš€ 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.