Overfitting
Overfitting happens when a model learns the training data too well — including its noise and quirks — so it performs great on training data but poorly on new, unseen data.
Data & AI
An overfit model has essentially memorized the answers instead of learning the general pattern. The telltale sign is a big gap between high training accuracy and low test accuracy.
It's like a student who memorizes the exact answers to last year's exam but can't solve any new problem. Common fixes include using more training data, simplifying the model, and regularization techniques.
Examples
Python
# Symptom of overfitting
print("Train accuracy:", model.score(X_train, y_train))
print("Test accuracy: ", model.score(X_test, y_test))Output:
Train accuracy: 0.99
Test accuracy: 0.71