Machine Learning Theory


Machine Learning Theory

Corey
Okay, Simon, we need to cover learning theory today. It's all about what really happens under the hood in machine learning, you know? The key assumptions and why things generalize.

Simon
Right. So first off, the core assumption is that there's a fixed but unknown data distribution, and our training and test data come from that same distribution, independently. That's crucial for any theory to work.

Corey
Exactly. And we feed a random sample into a learning algorithm, and out comes a hypothesis, which is also a random variable. That randomness is key—it leads to the bias-variance trade-off.

Simon
Yeah, bias and variance are properties of that random hypothesis. Bias is how far its expectation is from the true function, and variance is its spread. You can visualize it in parameter space.

Corey
Right. High bias means you're systematically off, almost regardless of data. High variance means you're too sensitive to noise. The trade-off is everywhere: more data reduces variance, regularization adds bias but cuts variance.

Simon
And you can decompose the total error into three parts: irreducible error (Bayes error), approximation error (cost of choosing a limited hypothesis class), and estimation error (due to finite data).

Corey
Yes. The estimation error can further be split into bias and variance. So approximation error plus estimation bias plus estimation variance plus irreducible equals your generalization error.

Simon
Good. Then we get to empirical risk minimization, or ERM. That's just minimizing training error. But the big question is: does a low training error guarantee a low test error?

Corey
That leads to uniform convergence. We can bound the difference between training and test error for all hypotheses using two tools: the union bound and Hoeffding's inequality.

Simon
Right. For a fixed hypothesis, Hoeffding says the probability that the gap exceeds gamma is at most 2 exp(-2 gamma^2 m). Then we union over all K hypotheses in a finite class, giving an extra factor of K.

Corey
So we get: with probability 1-delta, for all h in H, |ε̂(h)-ε(h)| ≤ √(log(2K/δ)/(2m)). That tells us how many samples we need to guarantee a certain margin—sample complexity.

Simon
And then we can bound how well the ERM hypothesis performs compared to the best in class. It turns out: ε(ĥ) ≤ ε(h*) + 2√(log(2K/δ)/(2m)). So with enough data, you get close to the best in class.

Corey
But what if the hypothesis class is infinite, like all linear classifiers? That's where VC dimension comes in. It's a way to measure the capacity of the class.

Simon
Exactly. The VC dimension is the size of the largest set that the class can shatter. For linear classifiers in d dimensions, it's d+1. Then the bound becomes O(√(VC(H)/m) ), so the sample complexity scales with VC dimension.

Corey
The key takeaway: more complex models (higher VC dimension) need more data to avoid overfitting. So it's not just about the number of parameters, but the expressive power of the class.

Simon
Right. And that's the whole story: from bias-variance to error decomposition, to ERM and uniform convergence, and finally VC dimension for infinite classes. It all ties together why learning works.

Ask anything
We've read this whole study set, so questions about it get the best answers.