Foundations of Machine Learning
Machine learning allows computers to learn from experience rather than explicit developer rules. Formally, a program learns from experience with respect to a class of tasks and performance measure , if its performance at tasks in , as measured by , improves with experience .
Taxonomy of Machine Learning Systems
Algorithms are structured by their learning feedback:
- Supervised Learning: trained on labeled data to map inputs to continuous (regression) or discrete (classification) targets.
- Unsupervised: identifies patterns in unlabeled data (e.g., clustering).
- Semi-Supervised: combines few labeled and many unlabeled samples.
- Reinforcement: learns optimal actions via environment rewards.
Mathematical Formulation: ERM
Learning is formulated as empirical risk minimization. Given a hypothesis space and a loss function , we solve for a hypothesis that minimizes the average loss over the training set:
Generalization and the Bias-Variance Trade-off
A model’s generalization error on unseen data is decomposed into three components:
- Bias: error due to overly simplistic assumptions, causing underfitting.
- Variance: error due to high sensitivity to small training set fluctuations, causing overfitting.
- Irreducible Noise: inherent variance in the data distribution.
Generalization is evaluated by training parameters on a training set and testing performance on an independent test set.
Example: Train-Test Splitting
The following example demonstrates splitting data and verifying shapes to ensure proper evaluation setup:
Interactive Lab
Partition a dataset into independent training and test sets using scikit-learn. Adjust test_size to observe how split shapes change.
Exercise
Validate your understanding of generalization error trade-offs: