XenonStack Glossary: AI, Data and Cloud Terms Explained

Bias Errors in Machine Learning: Bias vs Variance

Written by Dr. Jagreet Kaur | 08 Feb 2023

A bias error in machine learning is the error that comes from wrong or overly simple assumptions in a model, which makes its predictions consistently differ from the true values. It is one of two main sources of model error, the other being variance.

This page is for technical and business leaders who want a clear definition. It covers bias and variance, the tradeoff between them, how to reduce bias errors and how they relate to AI agents.

What are bias errors in machine learning?

The Wikipedia article on the bias-variance tradeoff defines the bias error as an error from erroneous assumptions in the learning algorithm. Every model simplifies the target function it is trying to learn, so that it is easier to learn. When those simplifying assumptions are wrong for the problem, the model is consistently off target.

The MLU-Explain bias-variance guide puts it as the difference between the average prediction and the true value. It is a consistent offset that more training data alone does not remove.

How do bias errors relate to variance?

Variance is the other half. The Wikipedia article defines it as an error from sensitivity to small fluctuations in the training set: a high-variance model fits random noise and overfits. The ideal model aims to minimise both bias and variance, but reducing one usually raises the other.

AspectHigh biasHigh variance
CauseModel too simple or assumptions wrongModel too sensitive to the training sample
SymptomUnderfitting: poor on training and test dataOverfitting: good on training data, poor on new data
Typical fixMore expressive model or better featuresMore data, regularisation or a simpler model
StabilityPredictions stable but wrongPredictions change with each training set

The scikit-learn underfitting and overfitting example shows this visually: a straight line, a polynomial of degree 1, is not sufficient to fit the training samples and underfits, while a very high degree overfits by learning the noise in the training data.

What is the bias-variance tradeoff?

The Wikipedia article splits the expected error on unseen data into three parts: the squared bias, the variance, and the irreducible error that comes from noise in the problem itself. You can trade bias against variance, but you cannot remove the irreducible part.

As a rule of thumb, simple models such as linear regression, linear discriminant analysis and logistic regression tend to have higher bias and lower variance. Flexible models such as decision trees, k-nearest neighbours with a small k and support vector machines tend to have lower bias and higher variance. The Wikipedia article gives the example of a straight line fitted to data that is quadratic overall as a high-bias model.

How do you reduce bias errors?

  • Use a more flexible model or add informative features.
  • Reduce regularisation that is forcing the model to be too simple.
  • Train longer or tune the model settings, then check validation error.
  • Compare training and validation error: if both are high, suspect bias; if only validation error is high, suspect variance.

Cross-validation gives a quantitative check. The scikit-learn example evaluates underfitting and overfitting by cross-validation on a validation set. Our entry on hybrid learning models covers models that add an uncertainty estimate to a prediction.

How do bias errors relate to AI agents?

The word bias also has a second meaning, unfair bias in outcomes for groups of people. Statistical bias error is a different thing, though a model with a systematic error can feed both problems. An AI agent that acts on a biased model repeats the same error at scale, so it helps to measure bias on held-out data before an agent relies on a model. ElixirClaw is XenonStack's AI agents computing platform for building and running agents that use trained models.

What should you do first?

  1. Choose one model that drives a decision and a metric that matters for it.
  2. Plot training and validation error side by side.
  3. Decide whether the gap points to bias or variance.
  4. Change one thing at a time: model, features or regularisation.
  5. Record the result and the model version so the decision can be reviewed.

To map one decision your agents make from model output, and the data and policy it depends on, book a Context Workshop. See what happens in the workshop.

Frequently asked questions

What is bias error in machine learning?

It is the error that comes from wrong or overly simple assumptions in a learning algorithm, which makes predictions consistently differ from the true values.

What is the difference between bias and variance?

Bias is a consistent error from simplifying assumptions. Variance is an error from sensitivity to small changes in the training data. High bias tends to cause underfitting, and high variance tends to cause overfitting.

What causes high bias?

Using a model that is too simple for the problem, using features that miss the real signal, or applying too much regularisation can all cause high bias.

Can you remove bias and variance completely?

No. Reducing one usually increases the other, and some error is irreducible because the problem itself contains noise.

Is bias error the same as bias in AI ethics?

No. Bias error is a statistical property of how a model fits data. Unfair bias refers to unequal outcomes for groups of people. They are related but need separate checks.