MIT 6.790 — Lecture 6
Uncertainty, Regularizers, and Features
§ Aleatoric vs. Epistemic Uncertainty
There are two types of uncertainty that we would like to conceptually differentiate here.
Aleatoric Uncertainty. This refers to uncertainty caused by the intrinsic randomness in how the response relates to the feature vector . It's the uncertainty in the PDF .
Epistemic Uncertainty. This refers to uncertainty caused by an incomplete model of the data being perceived. It's the uncertainty in the posterior caused by an insufficient amount of data.
Reading in more data will generally lessen the epistemic uncertainty, but more data won't be able to help with aleatoric uncertainty. As Lecture 5 showed, a misspecified model will produce great aleatoric uncertainty, yet the posterior overconfidently presents itself with very high epistemic certainty as it receives more data.
Remark. This overconfidence isn't unique to the Bayesian setting, of course; in the frequentist setting, standard errors and CI-widths also generally decrease as more data is read, even if the aleatoric uncertainty remains high.
§ MAP for Bayesian Linear Regression
We'll make some simplifying assumptions about our prior: assume , where is the feature dimension. Then the posterior looks like the following; compare with the proof in Lecture 5, perhaps.
Then the maximum a posteriori (MAP) satisfies the following:
Theorem. (Bayesian MAP) The maximum a posteriori for Bayesian linear regression, under the prior , is:
Proof: The first equality is trivial, so it remains to show the RHS expression for minimizes the middle expression. A shortcut is to just reuse the results we derived from Lecture 5, but for .
The posterior distribution is a Gaussian , so it is maximized at . The result falls right out from there.
The quantity being minimized in the theorem statement above is referred to as the ridge regression objective.
It is the sum of our ordinary squared-loss and a new “ridge regression term”, the latter of which penalizes point estimates that have needlessly large coefficients—large coefficients in often suggest overfitting.
We'll oftentimes denote in the ridge regression objective and expression for . Note that, while we can choose the value of in our prior, we usually have no control or knowledge regarding . So the value of can alternatively be interpreted as a parameter of our choosing that indicates how strongly we want to discourage overfitting.
§ Features
Let's stop restricting ourselves to linear models. The idea is to create our own feature vectors whose entries are nonlinear functions of the entries of the feature vectors .
Definition. We define our own features as and write our regression hypothesis as .
Example. In the case of , we might take , which yields the hypothesis .
Example. In the case of , we might take , and the set of all possible hypotheses becomes the set of all two-variable quadratic polynomials.
Here's how regression performs when we get nonlinear features involved.

Notice how setting the feature dimension too large results in overfitting, to the point where our degree- regression is just performing Lagrange interpolation. To reduce overfitting, let's bring back a trick from just a few paragraphs ago: ridge regression.

And so degree- regression works just fine with a ridge regression term using .
§ Kernel: Unlimited Features
There's another reason why too many features is bad: if we let (with rows ) be our stand-in for , then the ridge solution looks like:
Computing this would require a matrix inversion, which is far too computationally intensive for . So it seems like there is an upper bound on the number of features we can reasonably have.
Or maybe there isn't! We claim that there is an alternative way to approach our computation of ridge regressions that allows for to be arbitrarily large at no computational cost; the rest of this section is dedicated to showing how.
First, we claim the following theorem is true; the proof is unenlightening algebraic manipulation, so we omit it.
Theorem. (Bayesian MAP, Rewritten) The ridge solution may be expressed as:
Note, importantly, that this implies that the ridge regression may be expressed as:
In this form, it turns out that there's a great amount of simplification to be made if we introduce the following:
Definition. The kernel is the function (where is the input space) given by .
Given data , we may define a map via . (Yes, overloaded notation.)
Given data , we may define a matrix given by .
We can now again rewrite the ridge regression formula using the language of the kernel.
Theorem. (Bayesian MAP, w/ Kernel) The ridge regression may be expressed as:
Here's the upshot of all of this: the expression above only deals with matrices in and vectors in ; there's no dependency on anywhere! So as long as we can efficiently compute the kernel , we can set our number of features as large as we'd like.