Search Knowledge

© 2026 LIBREUNI PROJECT

Machine Learning / Introduction & Foundations

Foundations of Machine Learning

Foundations of Machine Learning

Machine learning allows computers to learn from experience rather than explicit developer rules. Formally, a program learns from experience EE with respect to a class of tasks TT and performance measure PP, if its performance at tasks in TT, as measured by PP, improves with experience EE.

Taxonomy of Machine Learning Systems

Algorithms are structured by their learning feedback:

  1. Supervised Learning: trained on labeled data (xi,yi)(x_i, y_i) to map inputs to continuous (regression) or discrete (classification) targets.
  2. Unsupervised: identifies patterns in unlabeled data (e.g., clustering).
  3. Semi-Supervised: combines few labeled and many unlabeled samples.
  4. Reinforcement: learns optimal actions via environment rewards.

Mathematical Formulation: ERM

Learning is formulated as empirical risk minimization. Given a hypothesis space H\mathcal{H} and a loss function L(y,h(x))L(y, h(x)), we solve for a hypothesis h^H\hat{h} \in \mathcal{H} that minimizes the average loss over the training set:

h^=argminhH1ni=1nL(yi,h(xi))\hat{h} = \arg\min_{h \in \mathcal{H}} \frac{1}{n} \sum_{i=1}^{n} L(y_i, h(x_i))

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:

python

Interactive Lab

Partition a dataset into independent training and test sets using scikit-learn. Adjust test_size to observe how split shapes change.

Step 1
Inspect the idea
Step 2
Edit the program
Step 3
Run and compare

Exercise

Validate your understanding of generalization error trade-offs:

What is the consequence of selecting a hypothesis space that is too complex for the training data size?

References & Further Reading

Next Module Model Evaluation