DATASCI 447 Lecture 2: Probabilistic ML

Kevin McAlister

January 15, 2026

Administrative Stuff

Discriminative Models

We’re going to start with a familiar class of learning methods and use these as the building blocks for new stuff

As with most applied statistics, we’re going to start with the workhorse - linear regression

  • \(\mathbf X\) is a \(N \times P\) matrix of training features (where \(P\) includes a vector of 1s to account for the intercept)
  • \(\mathbf y\) is a \(N\) vector of outcomes (continuous or class labels)

The linear regression model says:

\[ \hat{y} = g(\mathbf x^T \hat{\boldsymbol \beta}) \]

Discriminative Models

The predictive goal:

Find values of \(\hat{\boldsymbol \beta} \in \mathbb R^P\) that do a good job of predicting \(y\) for any viable feature combination \(\mathbf x\) that could occur

  • e.g. not necessarily in the training data

Linear regression methods represent one specific class of potential predictive functions that could be used

  • Mean functions, as we will soon see
  • Way more flexible of a formulation than it seems…

Discriminative Models

\[ \hat{y} = g(\mathbf x^T \boldsymbol \beta^*) \]

Choose \(\boldsymbol \beta^*\) that makes \(\hat{y} \approx y\)

How do we do that?

Discriminative Models

Without specification of a loss function, we have no meaningful way to judge how good our predictive model is.

Loss function

A function \(L(\cdot)\) that takes in the truth and a prediction

  • Returns 0 if truth = prediction

  • Returns larger positive values as predictions move further from the truth.

Discriminative Models

Our goal, then, is to find the coefficients that minimize the loss!

Empirical (average) loss

For a training set, \(\{ \mathbf X, \mathbf y\}_{i = 1}^N\), the empirical loss can be computed as:

\[ \frac{1}{N} \sum \limits_{i = 1}^N L(y_i , \hat{y}_i) \]

For linear regression:

\[ \hat{\boldsymbol \beta} = \underset{\boldsymbol \beta^*}{\min} \frac{1}{N} \sum \limits_{i = 1}^N L(y_i , \mathbf x_i^T \boldsymbol \beta^*) \]

Conceptual question: Is this the actual loss that we want to minimize when building a good predictive model?

Discriminative Models

The predictive goal revolves around minimizing the true risk or generalization error

Assume each instance of \(\{ \mathbf x, y\}\) is drawn from the Nature box:

\[ P(X,Y) = \mathcal T \]

The true risk that we want to minimize is:

\[ E_{\mathcal T}[L(y , \mathbf x^T \beta^*)] \]

Can we directly minimize this?

Discriminative Models

We don’t know the Nature box!

  • So we can’t compute the true loss directly.

\[ \text{True Risk} = \text{Empirical Risk} + \mathcal{O}\left(\frac{C}{N}\right) \]

  • For a model with \(N\) training examples and a fixed complexity, the minimum generalization error can be found where the empirical risk is smallest

  • There exists a balance between empirical risk and complexity (e.g. the Bias/Variance tradeoff)

  • Larger \(N\) means that the gap between the empirical risk and the true risk is small

Discriminative Models

\[ \hat{\boldsymbol \beta} = \underset{\boldsymbol \beta^*}{\min} \frac{1}{N} \sum \limits_{i = 1}^N L(y_i , \mathbf x_i^T \boldsymbol \beta^*) \]

Is this the actual loss that we want to minimize when building a good predictive model?

Kinda!

  • Given a class of models, find the one that minimizes the empirical risk

  • Use methods to approximate the true risk conditional on the empirical risk

What approaches exist for approximating the true risk?

  • Hint: we need to judge how well it performs on data that is not included in the empirical risk computation.

Discriminative Models

  1. Analytical approximations like the AIC/BIC when the model variance has a known form
  2. Simulation methods
    1. Cross validation
    2. Out of bag errors (with bagging)
    3. Single Train/Validation splits when \(N\) is large enough

But, the game is still to minimize the empirical loss based on the training data.

Discriminative Models

So, the last thing we need to do is specify the loss function

The common choices we make depend on the type of outcome we are trying to predict

  1. Continuous Outcomes - MSE or MAE
  2. Binary Outcome - BCE
  3. Categorical Outcome - Cross Entropy

Discriminative Models

If \(y\) is a continuous outcome, the most common choice is mean squared error:

\[ \hat{\boldsymbol \beta} = \underset{\boldsymbol \beta^*}{\min} \frac{1}{N} \sum \limits_{i = 1}^N (y_i - \theta_i^*)^2 \]

\[ \theta_i^* = \mathbf x_i^T \boldsymbol \beta^* \]

This admits the standard ordinary least squares solution:

\[ \hat{\boldsymbol \beta} = (\mathbf X^T \mathbf X)^{-1} \mathbf X^T \mathbf y \]

Discriminative Models

This isn’t the only choice - we could fit to minimize mean absolute error:

\[ \hat{\boldsymbol \beta} = \underset{\boldsymbol \beta^*}{\min} \frac{1}{N} \sum \limits_{i = 1}^N |y_i - \theta_i^*| \]

\[ \theta_i^* = \mathbf x_i^T \boldsymbol \beta^* \]

  • No closed form solution, but can be solved using computational optimization techniques

Question: What does MAE do that MSE does not? When is this a good loss function to use?

Discriminative Models

When our outcome is binary (0/1), the most common choice is to use binary cross entropy after transforming the linear predictor via the sigmoid function (e.g. logistic regression):

\[ \hat{\boldsymbol \beta} = \underset{\boldsymbol \beta^*}{\min} -\frac{1}{N} \sum \limits_{i = 1}^N \left[ y_i \log \theta_i + (1 - y_i)\log(1 - \theta_i) \right] \]

\[ P(y_i = 1 | \boldsymbol \beta^*, \mathbf x) = \theta_i^* = \sigma(\mathbf x_i^T \boldsymbol \beta^*) \]

Discriminative Models

When our outcome is categorical ( \(y_i \in (1,2,...,K)\) ), the most common choice is cross entropy after transforming the predictor via the softmax function (e.g. multinomial logistic regression):

\[ \hat{\mathbf W} = \min_{\mathbf{W}} \mathcal{L}(\mathbf{W}) = - \frac{1}{N} \sum_{i=1}^N \sum_{k=1}^K \mathbb{1}(y_i = k) \log \theta_{ik} \]

\[ P(y_i = k | \mathbf W^*, \mathbf x) = \theta_{ik} = \frac{\exp[z_{ik}]}{\sum \limits_{h = 1}^K \exp[z_{ih}]} \]

\[ z_{ik} = \mathbf x_i^T \mathbf w_k \]

where \(\mathbf W\) is a \(P \times K\) matrix where the \(k^{th}\) column contains coefficients for the \(k^{th}\) class.

Discriminative Models

More broadly, we can define these loss functions as the minimization targets for any function \(f_{\theta}(\mathbf x)\) that maps the inputs to outputs:

MSE \(\frac{1}{N} \sum \limits_{i = 1}^N (y_i - f_{\theta}(\mathbf x_i))^2\)
MAE \(\frac{1}{N} \sum \limits_{i = 1}^N |y_i - f_{\theta}(\mathbf x_i)|\)
BCE \(-\frac{1}{N} \sum \limits_{i = 1}^N y_i \log f_{\theta}(\mathbf x_i) + (1- y_i) \log (1 - f_{\theta}(\mathbf x_i))\)
CE \(\frac{1}{N} \sum \limits_{i = 1}^N \sum \limits_{k = 1}^K \mathbb 1(y_i = k) \log f_{\theta}(\mathbf x_i)\)
  • Linear models, random forests, boosted trees, neural networks all fall under this framework!

Discriminative Models

These loss functions are the basis of most discriminative machine learning.

From last class, our goal is to learn something about the Nature box

  • \(P(X,Y) = P(Y | X) P(X)\)

Where do distributions come in?

  • How can we learn about the joint distribution?

Probabilistic Learning

It turns out that you’ve been doing it the whole time without even realizing it

Key point:

Your choice of loss function implicitly chooses a conditional distribution for the outcome given the inputs

  • When you choose a loss function to minimize, you’re implicitly placing a distributional form on \(P(Y | X)\)

That distribution has:

  • Width

  • Tails

  • Support (viable set of values)

that dictate how your model handles mistakes

Probabilistic Learning

Our \(N\) training instances form an empirical distribution from which we are trying to learn a reasonable functional approximation

Probabilistic Learning

The empirical conditional distributions that we learn say that:

\[ P(Y = y_i | X = x_i) = 1 \]

  • All we observe is a single instance for each value of \(x\)

Taken at face value, the data we observe is indicative of what we’ll always see!

  • But, we know that this isn’t true.

Probabilistic Learning

\[ y = f_{\theta}(\mathbf x) + \epsilon \]

where \(\epsilon\) is a draw from the noise distribution

  • Idiosyncratic errors that are made due to randomness or inability of our current feature set to explain the variation

Therefore

\[ y \neq f_{\theta}(\mathbf x) \]

and we assume that noise follows some structure

  • \(E[\text{Noise}] = 0\)

  • \(V[\text{Noise}] = \sigma^2\)

Right?

Probabilistic Learning

It turns out that your choice of loss function also tells us what the distribution of that noise is!

  • In turn, tells us the distribution of the outcome conditional on the input

To show this, we’re going to start with an assumption and back our way into the identity

Let’s assume that:

\[ f(\epsilon) \sim \mathcal N(\epsilon | 0, \sigma^2) \]

  • A normal distribution with mean 0 and variance \(\sigma^2\)

Probabilistic Learning

Since adding a constant to a distribution changes only the expectation:

\[ y = f_{\theta}(\mathbf x) + \epsilon \]

implies

\[ y \sim \mathcal N(y | f(\mathbf x) , \sigma^2) \]

  • Each \(y\) is a draw from a normal distribution dictated by the input and noise

Probabilistic Learning

The goal: find the normal distributions that are most likely to have generated the observed outcomes!

Probabilistic Learning

Goal: Find a form of the conditional distribution that is most likely to have generated the data

Key Assumption: Each \(y | x\) is an independent and identically distributed draw.

Most likely to generate = max probability/density

\[ P(y | \mathbf X) = \prod \limits_{i = 1}^N P(y_i | \mathbf x) \]

  • Because each \(y\) is a conditionally independent draw, the joint probability with which we would see all of the \(y\) values is the product

Probabilistic Learning

Given a set of \(y\) values and corresponding \(\mathbf x\) values and a choice of function, our goal is to find the conditional distribution type such that:

\[ \underset{\theta}{\max} \prod \limits_{i = 1}^N P(y_i | \mathbf x_i , \boldsymbol \theta) \]

where \(\boldsymbol \theta\) is the set of unknowns that we’re trying to learn

Note: Products of numbers less than 1 get smaller and smaller - don’t do that.

Instead, recognize that logs are 1-to-1 functions that will preserve the max

\[ \underset{\theta}{\max} \sum \limits_{i = 1}^N \log P(y_i | \mathbf x_i , \boldsymbol \theta) \]

Probabilistic Learning

This approach to estimating the values of the unknowns is called maximum likelihood estimation

  • Given an assumption about the distribution that generated the data, find values for the unknowns that maximize the joint probability/likelihood that the data was generated from the distributional structure

But how does this link to loss?

Probabilistic Learning

Back to our normal assumption:

\[ \underset{\{\theta, \sigma^2\}}{\max} \sum \limits_{i = 1}^N \log \mathcal N(y_i | f_{\theta}(\mathbf x_i) , \sigma^2) \]

The normal distribution:

\[ \frac{1}{2 \pi \sigma^2} \exp \left[- \frac{1}{2 \sigma^2} (y_i - f_{\theta}(\mathbf x_i))^2 \right] \]

Taking the log:

\[ - \log 2 \pi \sigma^2 - \frac{1}{2 \sigma^2} (y_i - f_{\theta}(\mathbf x_i))^2 \]

Probabilistic Learning

Now the log of the joint:

\[ \sum \limits_{i = 1}^N - \log 2 \pi \sigma^2 - \frac{1}{2 \sigma^2} (y_i - f_{\theta}(\mathbf x_i))^2 \]

Making some simplifications:

\[ - \log 2 \pi \sigma^2 - \frac{1}{2 \sigma^2 N} \sum \limits_{i = 1}^N (y_i - f_{\theta}(\mathbf x_i))^2 \]

Probabilistic Learning

Wait - the only part where \(\theta\) comes in is in the summation

  • \(\sigma\) is a part of the normalizing constant since we assume \(\sigma\) is constant across observations

\[ \underset{\{\theta\}}{\max} - Z \frac{1}{N} \sum \limits_{i = 1}^N(y_i - f_{\theta}(\mathbf x_i))^2 \]

\[ \underset{\{\theta\}}{\min} \frac{1}{N} \sum \limits_{i = 1}^N(y_i - f_{\theta}(\mathbf x_i))^2 \]

Probabilistic Learning

By choosing to minimize the MSE, we’re implicitly choosing values for unknowns that will maximize the probability that they were generated from a normal distribution

And we’re making assumptions about what the noise looks like (and doesn’t look like)

Probabilistic Learning

Probabilistic Learning

Linear regression via MLE under MSE Loss

\[ \hat{y} = \mathbf x_i^T \boldsymbol \beta \]

\[ y \sim \mathcal N(y | \mathbf x_i^T \boldsymbol \beta , \sigma^2) \]

We’ll skip the derivation here because it’s going to look familiar:

\[ \hat{\boldsymbol \beta} = (\mathbf X^T \mathbf X)^{-1} \mathbf X^T \mathbf y \]

\[ \hat{\sigma^2} = \frac{1}{N} \sum \limits_{i = 1}^N (y_i - \mathbf x_i^T \hat{\boldsymbol \beta})^2 \]

Probabilistic Learning

Probabilistic Learning

Probabilistic Learning

Log-likelihoods reward overlapping the bumps with the empirical spikes

Log-likelihoods punish us for leaving spikes in low-density regions

e.g. Log-likelihoods punish us when our “loss” is big!

It turns out that likelihood is the only strictly proper, local scoring rule for probability distributions

  • Nerd speak for if the truth is optimal, it is maximized

  • See Savage (1971) and Dawid (1986)

Probabilistic Learning

This distribution to loss relationship runs even deeper…

The Laplace Distribution:

\[ p(y | f(\mathbf{x}), b) = \frac{1}{2b} \exp \left( -\frac{|y - f(\mathbf{x})|}{b} \right) \]

Log-likelihood:

\[ \sum_{i=1}^N \log p(y_i | f(\mathbf{x}_i), b) = \sum \limits_{i=1}^N \left[ -\log(2b) - \frac{|y_i - f(\mathbf{x}_i)|}{b} \right] \]

See a loss function?

Probabilistic Learning

Probabilistic Learning

For classification, assume \(y | x\) follows a Bernoulli distribution and \(f(\mathbf x)\) is contrained to be between 0 and 1:

\[ P(y_i | \mathbf{x}_i) = f(\mathbf{x}_i)^{y_i} (1 - f(\mathbf{x}_i))^{1 - y_i} \]

Log-likelihood:

\[ \ell(\theta) = \sum_{i=1}^N \left[ y_i \log f_{\theta}(\mathbf{x}_i) + (1 - y_i) \log (1 - f_{\theta}(\mathbf{x}_i)) \right] \]

Negative log-likelihood:

\[ -\ell(\theta) = -\sum_{i=1}^N \left[ y_i \log f_{\theta}(\mathbf{x}_i) + (1 - y_i) \log (1 - f_{\theta}(\mathbf{x}_i)) \right] \]

Familiar?

Probabilistic Learning

A note about the Bernoulli/Normal:

MLE estimation under constant variance assumption (or constant functional assumption) makes the variance of the resulting conditional distributions a function of the mean function

Normal: \[ V[X] = \sigma^2 \]

Bernoulli:

\[ V[X] = f(\mathbf x_i) \left[1 - f(\mathbf x_i) \right] \]

This will matter soon!

Probabilistic Learning: Taking Stock

We’ve established that:

  • Your choice of loss function implicitly specifies a conditional distribution \(p_{\theta}(y | x)\)
  • Minimizing loss = Maximizing log-likelihood
  • We fit models by finding \(\theta\) that makes the observed data most probable

But there’s a deeper question we haven’t answered:

Why is maximum likelihood the “right” thing to do?

The Fundamental Problem

We have two distributions:

Empirical Distribution \(\hat{p}(y|x)\)

  • What we observe in our data
  • Delta spikes at training points
  • The “truth” (as far as we know)

Model Distribution \(p_{\theta}(y|x)\)

  • Our smooth approximation
  • Parameterized by \(\theta\)
  • What we’re trying to learn

Core Question: How do we measure how “close” these two distributions are?

Why We Need a Distance Measure

  • We want \(p_{\theta}(y|x)\) to be similar to \(\hat{p}(y|x)\)
  • But distributions are functions, not points in space!
  • We can’t just use Euclidean distance
  • We need a measure that respects the probabilistic structure

Goal: Find a principled way to measure distributional “closeness” that:

  1. Is always non-negative
  2. Equals zero only when distributions match
  3. Has a clear probabilistic interpretation

From Likelihood to Divergence

We’ve been maximizing: \[ \max_{\theta} \sum_{i=1}^N \log p_{\theta}(y_i | x_i) \]

But what are we really doing?

  • We’re making \(p_{\theta}\) “agree” with \(\hat{p}\) where we have data
  • We’re minimizing some notion of “distance” between distributions
  • This distance is called the Kullback-Leibler (KL) divergence

Next: Let’s formalize this and see why MLE emerges naturally from minimizing distributional distance.

Why Do We Need a Distance Between Distributions?

  • We have an empirical distribution \(\hat{p}(y | x)\) (the data)
  • We have a model distribution \(p_{\theta}(y | x)\) (our approximation)
  • We want to measure how “close” these distributions are
  • But distributions are functions, not points!
  • We need a proper divergence measure

Kullback-Leibler (KL) Divergence

The KL divergence from distribution \(Q\) to distribution \(P\) is:

\[ D_{KL}(P \| Q) = \sum_{y} P(y) \log \frac{P(y)}{Q(y)} \]

Or for continuous distributions:

\[ D_{KL}(P \| Q) = \int P(y) \log \frac{P(y)}{Q(y)} \, dy \]

Properties:

  • Always non-negative: \(D_{KL}(P \| Q) \geq 0\) (Gibbs inequality)
  • Equals zero only when \(P = Q\)
  • Not symmetric: \(D_{KL}(P \| Q) \neq D_{KL}(Q \| P)\)

KL Divergence: Intuition

\[ D_{KL}(P \| Q) = \mathbb{E}_{y \sim P} \left[ \log \frac{P(y)}{Q(y)} \right] \]

Interpretation:

  • Expected difference in log-probability between \(P\) and \(Q\)

  • When \(P(y)\) is high but \(Q(y)\) is low → large penalty

  • Measures the “information lost” when approximating \(P\) with \(Q\)

Asymmetry matters! We typically minimize \(D_{KL}(\hat{p} \| p_{\theta})\) where \(\hat{p}\) is the true/empirical distribution and \(p_{\theta}\) is our model.

KL Divergence

Key Insight: When means differ, P assigns high probability where Q assigns low probability → large penalty!

KL Divergence

Key Insight: P (narrower) is more concentrated. Q (wider) under-represents the peak → penalty!

KL Divergence

Key Insight: When P ≈ Q, divergence is near zero. Distributions are nearly indistinguishable!

From Empirical to Model Distribution

In supervised learning, our empirical distribution is:

\[ \hat{p}(y | x) = \frac{1}{n} \sum_{i=1}^n \delta(\mathbf x - x_i, y - y_i) \]

(A sum of delta spikes at the observed data points)

We want to find \(\theta\) that minimizes:

\[ D_{KL}(\hat{p} \| p_{\theta}) = \sum_{x,y} \hat{p}(y|x) \log \frac{\hat{p}(y|x)}{p_{\theta}(y|x)} \]

Simplifying the KL Divergence

\[ D_{KL}(\hat{p} \| p_{\theta}) = \sum_{x,y} \hat{p}(y|x) \log \hat{p}(y|x) - \sum_{x,y} \hat{p}(y|x) \log p_{\theta}(y|x) \]

  • First term: Entropy of the empirical distribution (constant w.r.t. \(\theta\))
  • Second term: Negative expected log-likelihood under the empirical distribution
  • Minimizing KL divergence = Maximizing the second term

The Key Result

\[ \min_{\theta} D_{KL}(\hat{p} \| p_{\theta}) \equiv \max_{\theta} \sum_{x,y} \hat{p}(y|x) \log p_{\theta}(y|x) \]

Since \(\hat{p}(y|x) = \frac{1}{n} \sum_{i=1}^n \delta(x - x_i, y - y_i)\):

\[ \max_{\theta} \sum_{x,y} \hat{p}(y|x) \log p_{\theta}(y|x) = \max_{\theta} \frac{1}{n} \sum_{i=1}^n \log p_{\theta}(y_i | x_i) \]

Minimizing KL divergence is equivalent to Maximum Likelihood Estimation!

Why MLE Works

  1. We want our model distribution \(p_{\theta}\) to be close to the true distribution
  2. KL divergence measures this “closeness”
  3. Minimizing KL divergence w.r.t. \(\theta\) drops constant terms
  4. What remains is maximizing \(\sum_{i=1}^n \log p_{\theta}(y_i | x_i)\)
  5. This is exactly the log-likelihood!

Bottom line: Maximum Likelihood Estimation is the principled way to fit probabilistic models by minimizing distributional distance.

Why Does KL Divergence Matter if MLE Does the Same Thing?

Three key reasons we need to understand KL divergence:

1. Variational Inference & Approximate Posteriors

  • When exact Bayesian inference is intractable, we’ll approximate \(p(\theta | data)\) with a simpler distribution \(q(\theta)\)
  • We minimize \(D_{KL}(q \| p)\) to find the best approximation
  • This is the foundation of Variational Autoencoders (VAEs) and modern Bayesian deep learning

Why Does KL Divergence Matter if MLE Does the Same Thing?

2. Generative Models & Distribution Matching

  • GANs, diffusion models, and normalizing flows all try to match a learned distribution to a target
  • Understanding forward vs. reverse KL (\(D_{KL}(p \| q)\) vs \(D_{KL}(q \| p)\)) explains why different models behave differently
  • Mode-seeking vs. mode-covering behavior comes directly from KL asymmetry

Why Does KL Divergence Matter if MLE Does the Same Thing?

3. Model Comparison & Selection

  • Information criteria (AIC, BIC, DIC) are all based on KL divergence
  • Cross-entropy loss in neural networks is minimizing KL divergence
  • Understanding the distributional basis helps us design better loss functions for specific problems

Coming soon: Bayesian methods, deep generative models, and uncertainty quantification!

Under Pressure

Under Pressure

Maximizing the log-likelihood introduces a pressure on the model.

  • Since all we see is the empirical distribution, our goal is to place as much mass as possible at the observed locations

  • Respecting the assumed conditional distribution structure and the constraint that the mean of the distribution follows the mean function

For regression - \(f_{\theta}(\mathbf x) = \mathbf x^T \boldsymbol \beta\)

Under Pressure

Under Pressure

One way to increase the flexibility of the linear model is to add polynomial terms.

Question: What’s going to happen to the MLE estimate of \(\sigma^2\) when we add more terms?

\[ \hat{\sigma^2} = \frac{1}{N} \sum \limits_{i = 1}^N (y_i - \mathbf x_i^T \hat{\boldsymbol \beta})^2 \]

Adding more terms always decreases the average residual.

  • More terms means lower estimated extra variance

Under Pressure

There’s a more unifying way to think about this concept without relying on polynomials alone

  • For nested classes of models (moving from the simplest model to the most complex), increasing the curvature budget (e.g. flexibility) necessarily decreases the MLE estimate of \(\sigma^2\).

Under Pressure

Under Pressure

Under Pressure

Under Pressure

Under Pressure

Under Pressure

Under Pressure

As the flexibility of our model increases, the pressure that comes from minimizing the KL divergence with the empirical distribution dominates

  • Simple models combat the KL divergence pressure by limiting how complex the mean function can be

  • More complex models allow more complex mean functions meaning that there is more opportunity to place all of the mass of the conditional distributions exactly on the observed data points

Does this sound like a familiar concept?

Under Pressure

Finally, a definition of overfitting that makes sense:

Overfitting occurs due to probabilistic mass collapse around the empirical distribution

  • We take our empirical distribution a little too literally and end up saying that nothing else can actually happen!

Mitigating Pressure

One thing that is always going to reduce the mass collapse behavior is increasing the size of the training data

  • As \(N \rightarrow \infty\), the empirical distribution approaches the true distribution!

Mitigating Pressure

Mitigating Pressure

Mitigating Pressure

Check-in question:

Imagine that our feature space is very high dimensional. What’s going to happen to the number of training examples needed to fill the space to make the empirical distribution \(\approx\) the true distribution?

It goes up!

  • Curse of dimensionality

  • I need more examples to represent the space in the box…

  • For images, there isn’t a \(N\) large enough!

Mitigating Pressure

Since there are some cases where getting an appropriate \(N\) is not possible, there are other strategies.

One thing that we can do is add a competing penalty to our loss function that will combat the overfitting problem.

Natural for the MSE - add a Ridge penalty:

\[ \hat{\boldsymbol \beta} = \underset{\boldsymbol \beta}{\min} \frac{1}{N} \|\mathbf y - \mathbf X \boldsymbol \beta \|^2 + \lambda \|\boldsymbol \beta\|^2 \]

Mitigating Pressure

With the MSE + Ridge penalty, there is a unique minimizer:

\[ \hat{\boldsymbol \beta} = (\mathbf X^T \mathbf X + \lambda \mathcal I_P)^{-1} \mathbf X^T \mathbf y \]

It turns out that the implied distribution when adding a L2 penalty is still normal! (more next time)

\[ P(y | \mathbf x, \boldsymbol \beta, \lambda) = \mathcal N(y | \mathbf x^T \hat{\boldsymbol \beta}, \hat{\sigma^2}) \]

where \(\hat{\sigma^2}\) is still the MSE.

Mitigating Pressure

Mitigating Pressure

Mitigating Pressure

Mitigating Pressure

Mitigating Pressure

Mitigating Pressure

Regularization works in the probabilistic sense by forcing mass in the conditional distribution away from the observed points.

  • Unless the sample size warrants the certainty!

Question: Which function do you think generated the data?

Why?

Mitigating Pressure

Turns out any of them could have generated that data

  • Probability, baby! Anything can happen.

This is a fundamental problem with attempting to solve inverse problems

  • Use generated data to learn about the truth

Why assume simplicity?

Mitigating Pressure

Next time:

  • Regularization is an assumption about the way the world really works.

  • Balances prior belief about a “good” solution with what the data says

  • Fits naturally in our distributional world