Lazy Learner Classifier
Machine learning algorithms are often grouped into eager learners and lazy learners based on when they actually do the work of learning from data.
Eager vs Lazy Learners
Eager Learner:
- Builds a general model during training (e.g. Logistic Regression, Decision Tree)
- Training takes longer, prediction is fast
Lazy Learner:
- Stores the training data and defers computation until prediction time
- Training is instant, prediction is slower
Why KNN is a Lazy Learner
KNN doesn't build an explicit model during training - it simply memorizes the training data. All the actual computation (finding neighbors and voting) happens when a new prediction is requested.
Trade-offs
Lazy learners adapt easily to new data since there's no retraining step, but they can become slow at prediction time as the dataset grows large, since every prediction requires scanning the stored data.
Because lazy learners keep the entire training set in memory, they can also require significantly more storage than eager learners that discard the raw data after training.
Coming Up Next
Next, you'll learn how to tune KNN's key hyperparameter - the value of k.