Mastering Occam's Razor
Parsimony in Model Selection
The Balancing Act
In statistical modeling, the goal isn't just to find a model that fits your data well. The goal is to find a model that fits your data well and also generalizes to new, unseen data. This introduces a fundamental tension between two types of errors: bias and variance.
Bias is the error introduced by approximating a real-world problem, which may be complex, with a much simpler model. High-bias models are often too simple and fail to capture the underlying patterns in the data. This is called underfitting.
Variance is the error introduced by a model being too sensitive to the specific data it was trained on. High-variance models are often too complex, capturing not just the underlying patterns but also the noise. This is called overfitting.
Think of it like tailoring a suit. A high-bias model is like a one-size-fits-all suit; it's too simple and doesn't fit anyone particularly well. A high-variance model is like a suit tailored so precisely to one person's exact posture on a specific day that it looks strange if they stand differently. The ideal model, like a well-tailored suit, captures the essential shape without being thrown off by minor, temporary details.
The relationship between these two is the bias-variance tradeoff. As you decrease a model's bias by making it more complex, you typically increase its variance. As you decrease its variance by simplifying it, you typically increase its bias. The total error of a model is a combination of its bias, its variance, and an irreducible error that comes from the inherent noise in the data itself.
Finding the sweet spot in this tradeoff—the bottom of that U-shaped curve—is the key to building a robust model. But we can't just eyeball it. We need a quantitative way to apply the principle of parsimony and penalize models for being unnecessarily complex.
Paying for Complexity
To move from the concept of parsimony to a practical method, we use information criteria. These are statistical measures that score a model based on both its goodness of fit and its simplicity. The two most common are the Akaike Information Criterion (AIC) and the Bayesian Information Criterion (BIC).
Both AIC and BIC work by starting with a measure of how well the model fits the data (specifically, the maximum likelihood of the model) and then subtracting a penalty term that increases with the number of parameters the model uses.
The Bayesian Information Criterion works similarly, but its penalty is more severe, especially for larger datasets.
When comparing a set of candidate models, the one with the lowest AIC or BIC value is considered the best. These are not absolute measures of quality; they are relative. Their power comes from comparing models against each other.
| Feature | Akaike Information Criterion (AIC) | Bayesian Information Criterion (BIC) |
|---|---|---|
| Penalty Term | ||
| Severity | Less severe penalty | More severe penalty, especially for large |
| Goal | Find the model that best predicts future data | Find the model that is most likely the true model |
| Tendency | Can favor slightly more complex models | Strongly favors simpler, more parsimonious models |
Overfitting in Practice
Let's consider a practical example. Suppose we're trying to predict house prices based on square footage. We collect some data and start building polynomial regression models.
A simple linear model () might not capture the curve in the data (high bias).
A quadratic model () might fit better.
What about a 10th-degree polynomial model? It will likely fit our training data almost perfectly, weaving through every single data point. It will have a very high likelihood value and a low training error. But if we try to use it on new data, its predictions will likely be wild and inaccurate. It has learned the noise, not the signal. It has overfit the data.
If we were to calculate AIC and BIC for these models, we would see a pattern. The AIC/BIC would drop as we move from the linear to the quadratic model, indicating a better balance. But as we continue adding polynomial terms, the penalty for complexity ( or ) would start to outweigh the small improvements in fit (), and the AIC/BIC scores would begin to rise. The model with the lowest score would give us the most parsimonious and effective choice.
The bias-variance trade-off is a fundamental concept in machine learning that describes the trade-off between two sources of error that affect the performance of predictive models: bias and variance.
By using tools like AIC and BIC, we can navigate this tradeoff systematically, ensuring our models are as simple as possible, but no simpler.
A statistical model that consistently makes the same kind of error by oversimplifying the true relationship in the data is said to have high what?
A model that performs exceptionally well on the data it was trained on but fails to make accurate predictions on new, unseen data is likely suffering from: