10.5 The Bias–Variance Trade-off
10.5 The Bias–Variance Trade-off
Section titled “10.5 The Bias–Variance Trade-off”Two fundamentally different sources of prediction error
Section titled “Two fundamentally different sources of prediction error”The concepts of underfitting and overfitting provide an intuitive understanding of model complexity. To analyze these phenomena more systematically, machine learning distinguishes between two fundamentally different sources of prediction error: bias and variance.
Although these terms originate from statistics, they have a clear conceptual interpretation.
A model with high bias makes systematic errors because it is too simple to capture the true relationship between the input and the output.
A model with high variance, in contrast, is excessively sensitive to the particular training data that happened to be observed. Small changes in the training dataset can lead to large changes in the learned model.
These two forms of error represent opposite consequences of model complexity.
Understanding how they interact is one of the central ideas in machine learning.
Bias: systematic error caused by overly simple models
Section titled “Bias: systematic error caused by overly simple models”Imagine trying to describe a winding mountain road using a single straight line.
No matter how carefully the line is positioned, it will never follow the bends of the road.
The error is therefore systematic.
The model is fundamentally incapable of representing the underlying structure.
This is precisely what bias describes.
A model with high bias makes similar mistakes regardless of which training data are available because its mathematical structure is too restrictive.
Returning to our protein stability example, suppose we insist on using a simple linear regression model even though the true relationship between hydrophobicity and stability is strongly nonlinear.
No amount of additional training data can solve this problem.
The limitation lies not in the data but in the model itself.
High bias therefore reflects an important principle:
A model cannot learn relationships that it is mathematically incapable of representing.
Increasing the amount of data does not eliminate bias. Instead, reducing bias requires a more expressive model.
Variance: sensitivity to the training data
Section titled “Variance: sensitivity to the training data”Variance describes a very different problem.
Imagine training several highly flexible models using slightly different datasets.
Each dataset contains approximately the same biological relationship but differs in the exact proteins that happened to be measured.
If the model is very flexible, it may adapt strongly to these small differences.
One model may learn a slight upward bend in one region.
Another may learn a downward bend in the same region.
Although both models fit their respective training datasets extremely well, they make different predictions for new proteins.
The predictions therefore depend strongly on the particular data used during training.
This instability is called variance.
High variance does not arise because the model is mathematically too simple.
Instead, it arises because the model is so flexible that it begins fitting random fluctuations in the available observations.
Consequently, the learned model changes substantially whenever the training data change.
Bias and variance describe the model—not the data
Section titled “Bias and variance describe the model—not the data”Students often confuse model variance with the natural variability present in biological experiments.
These are two entirely different concepts.
Biological data contain variability because living systems are inherently heterogeneous and because experimental measurements are never perfectly reproducible.
This variability is a property of the data.
Bias and variance, in contrast, describe properties of the learning algorithm.
Bias reflects the inability of a model to represent complex biological relationships.
Variance reflects the tendency of a model to adapt excessively to the particular observations available during training.
Keeping these concepts separate is essential.
The same biological dataset can produce
- high bias if analyzed using an overly simple model,
- or high variance if analyzed using an excessively flexible model.
Bias and variance are therefore not characteristics of biology itself, but of the mathematical model we choose to describe it.
The trade-off between bias and variance
Section titled “The trade-off between bias and variance”Increasing model complexity has opposite effects on bias and variance.
Simple models usually exhibit
- high bias,
- but low variance.
Because they are highly constrained, they cannot represent complex biological relationships. However, they also produce relatively stable predictions because small changes in the training data have little influence on the fitted model.
Highly flexible models behave in exactly the opposite way.
They exhibit
- low bias,
- but high variance.
Their expressive power allows them to capture complex relationships, but it also makes them sensitive to random fluctuations in the training data.
Consequently, reducing one type of error generally increases the other.
This tension is known as the bias–variance trade-off.
It explains why there is no universally optimal level of model complexity.
Instead, every prediction problem requires balancing these two competing sources of error.
Finding the optimal balance
Section titled “Finding the optimal balance”The bias–variance trade-off provides a deeper explanation for the U-shaped test-error curve introduced in the previous section.
At low model complexity, prediction errors are dominated by bias.
The model is simply too rigid to capture the biology.
As flexibility increases, bias decreases and prediction accuracy improves.
Beyond a certain point, however, variance begins to dominate.
The model starts fitting random fluctuations instead of general biological principles.
Prediction accuracy on unseen data therefore deteriorates.
The optimal predictive model lies precisely where the combined effects of bias and variance are smallest.
Importantly, this balance depends on the biological problem itself.
A simple relationship may require only a relatively simple model.
A highly nonlinear process may require a much more flexible one.
Machine learning therefore does not seek the most complex model.
It seeks the model whose complexity is appropriate for the underlying biological system.
From theory to practice
Section titled “From theory to practice”The bias–variance trade-off provides a conceptual explanation for why overfitting occurs.
Unfortunately, it does not immediately tell us where the optimal balance lies.
When analyzing a real biological dataset, we usually do not know the true underlying relationship.
Consequently, we cannot directly determine whether a model is underfitting or overfitting.
Instead, we require practical methods for estimating how well a model will perform on unseen data.
The most widely used approach is cross-validation, in which part of the available data is temporarily withheld during training and later used to evaluate prediction performance.
Cross-validation allows us to estimate a model’s ability to generalize before new experimental data become available.
It is therefore one of the most important tools in modern machine learning.
Key Concepts
Section titled “Key Concepts”- Bias is the systematic prediction error caused by an overly simple model.
- Variance measures how strongly a model depends on the particular training dataset.
- Bias and variance are properties of the learning model, not of the biological data.
- Increasing model complexity reduces bias but increases variance.
- The optimal predictive model balances these two competing sources of error.
Summary
Section titled “Summary”The bias–variance trade-off provides a theoretical framework for understanding underfitting and overfitting. Simple models are limited by high bias because they cannot represent complex biological relationships. Highly flexible models suffer from high variance because they become sensitive to random fluctuations in the training data. Successful machine learning requires balancing these two sources of prediction error. Since the optimal level of complexity is generally unknown, practical methods such as cross-validation are needed to estimate how well a model will generalize to new biological observations.
Self-Check Questions
Section titled “Self-Check Questions”- What is meant by bias in machine learning?
- What is meant by variance?
- Why are bias and variance properties of the model rather than the biological data?
- Why can collecting more training data reduce variance but not necessarily bias?
- How does increasing model complexity affect bias?
- How does increasing model complexity affect variance?
- Why is there no universally optimal model complexity?
- Why does the bias–variance trade-off motivate the use of cross-validation?