Training & Testing In Machine Learning
Training & Testing Machine Learning Models
Short description explaining what the learner will understand after completing this study map.
From Prepared Data to a Model
Once data has been prepared and an algorithm selected, the model must learn from examples and then be evaluated on data that was not used to fit it. Keeping training and testing roles distinct helps show whether the learned patterns generalize beyond the training examples.
Core idea: training data is used to fit the model; test data is used to evaluate how the trained model performs on unseen examples.
Essential Training Terms
Tap each card to review important concepts used when training and testing machine learning models.
Training a Model
During training, an algorithm processes training examples and adjusts the model so its predictions better match the patterns or targets in the data. The result of this learning process is a trained model that can be applied to new inputs.
Testing a Model
Testing evaluates the trained model using examples that were kept separate from model fitting. This provides evidence about how the model behaves on unseen data rather than simply measuring how well it remembers its training examples.
Training Data
Used by the learning algorithm to fit model parameters and learn patterns or relationships.
Test Data
Kept separate from fitting and used to evaluate the trained model on examples it did not learn from directly.
Train, Test, Review, Repeat
Model development is iterative. Results from testing can reveal weaknesses that lead to changes in data preparation, features, model settings, or even the chosen algorithm before the model is tested again.
Overfitting & Underfitting
Overfitting occurs when a model learns the training data too specifically and performs poorly on new data. Underfitting occurs when a model is too simple or insufficiently trained to capture important patterns, causing weak performance even on the underlying task.
Training Explorer
Explore the main stages involved in fitting, testing, and improving a machine learning model.
Key Takeaways
Focus on separation and iteration: train with one portion of the data, evaluate with unseen data, review the results, and improve the approach when necessary.
Core pattern: training fits the model; testing evaluates it on unseen examples; review and repetition help improve the model and identify problems such as overfitting or underfitting.
Common mistake: evaluating a model only on the same data used for training can give an overly optimistic impression of performance. Testing should use data that was not used to fit the model.
Knowledge Check
These questions test whether you can distinguish training from testing and recognize common model-development issues in practical scenarios.