The Hong Kong Polytechnic University · FACULTY OF COMPUTER SCIENCE

BME5150 Chap.4 Regression Error, Bias and Variance

- one subject, every graph, every model, every mark
6 Chapters3-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 4 of 7 · BME5150

Regression Error, Bias and Variance

Residuals preserve direction

A residual is the observed outcome minus the fitted prediction. Positive and negative values show which side of the prediction line a case falls on. Simply averaging signed residuals allows cancellation, so evaluation uses absolute values, squares or other transformations.

A residual plot can reveal curvature, changing variance and subgroup patterns that a single summary hides.

Error metrics punish misses differently

Mean absolute error averages absolute residuals and remains in the outcome unit. Mean squared error squares residuals, giving large misses extra influence. Root mean squared error returns that loss to the original unit while preserving the emphasis.

Mean absolute percentage error supports scale comparison but becomes unstable near zero. Choose from the consequence of error, not convenience.

Correlation and explained variation are narrower claims

Correlation measures linear association and direction. R-squared describes the fraction of observed outcome variation accounted for by the fitted linear model under its assumptions.

Neither proves causation, unbiased predictions or external transport. Adjusted R-squared penalises added predictors but still does not replace held-out testing.

Bias and variance use two error views

High training and validation errors suggest a model or representation too rigid for the signal. Low training error with much higher validation error suggests overfitting and high variance.

Remedies differ: revisit representation or complexity for underfitting, and strengthen regularisation, simplify or add representative data for overfitting.

The final test set remains untouched

Use development resampling to choose model form and tuning. Once a test result changes the model, that test set is part of development.

The final evaluation should describe the locked pipeline and the population on which the error was measured.

In this chapter

What this chapter covers

  • 01

    Observed and predicted values

  • 02

    MAE, MSE and RMSE

  • 03

    Percentage errors and near-zero outcomes

  • 04

    Correlation and R squared

  • 05

    Bias and variance patterns

  • 06

    Residual diagnostics and held-out testing

Worked example · free

Compare absolute and squared errors

Q [9 marks]. AskSia-authored practice. Observed outcomes are 10, 14 and 20, while predictions are 12, 13 and 17. Calculate residuals, MAE, MSE and RMSE, then explain why the summaries differ. The marks shown are an AskSia study allocation, not a University marking scheme.
Red dashed segments show signed vertical residuals between observed points and the fitted prediction line at the same predictor values.Red dashed segments show signed vertical residuals between observed points and the fitted prediction line at the same predictor values.Observed predictorOutcomeResiduals are vertical observed-minus-predicted distances
Red dashed segments show signed vertical residuals between observed points and the fitted prediction line at the same predictor values.
  • 3Calculate signed and absolute residuals.
  • 4Calculate MAE, MSE and RMSE.
  • 2Interpret the effect of the largest miss.
Residuals are −2, 1 and 3. MAE is (2 + 1 + 3)/3 = 2. MSE is (4 + 1 + 9)/3 = 4.667, and RMSE is about 2.160. RMSE is larger than MAE because squaring gives the three-unit residual extra influence. That emphasis is useful only when large errors deserve disproportionately greater concern.
Sia tip — Keep the residual sign during diagnosis, then apply the metric's transformation explicitly when summarising size.
Glossary

Key terms

Residual
A residual is an observed outcome minus its predicted value.
Mean Absolute Error
Mean absolute error averages residual magnitudes in the outcome unit.
Root Mean Squared Error
Root mean squared error is the square root of average squared residuals and emphasises large misses.
R Squared
R squared is the proportion of observed variation accounted for by a fitted linear model.
High Variance
High variance is sensitivity to development data that appears as much worse held-out than training performance.
FAQ

Regression Error, Bias and Variance FAQ

When should I prefer RMSE to MAE?

Prefer RMSE when large errors deserve extra influence and that weighting matches the clinical consequence. Prefer MAE for a linear, unit-preserving summary that is less dominated by extremes. Reporting both can reveal whether a small number of large misses drive performance.

Does a high R squared mean predictions are clinically accurate?

No. R squared summarises explained variation in the fitted data under a linear model. Predictions can still be biased, poorly calibrated or unreliable outside the development population. Inspect residuals and evaluate the locked model on held-out cases.

How do I distinguish underfitting from overfitting?

Compare training and held-out errors. High errors on both sides suggest high bias or missing structure. Low training error with substantially higher held-out error suggests high variance. Diagnose the pattern before choosing a remedy such as new features or stronger regularisation.

Study strategy

Assessment move

Create three small residual lists: one balanced around zero, one with a large outlier and one with a systematic positive shift. Compute MAE and RMSE for each and explain which pattern the averages hide. Next, draw a two-axis table with training error and validation error, then place underfitting and overfitting in the correct cells.

For every regression result in your notes, write the outcome unit beside MAE or RMSE and a population beside the held-out value. Finish by checking whether a reported R-squared statement has accidentally become a causal or generalisation claim. Sketch residuals against fitted values for the three lists and name the visible pattern before suggesting a remedy. This trains the move from summary error to structural diagnosis.

Working through Regression Error, Bias and Variance in BME5150? Sia is AskSia’s AI Computer Science tutor — ask any BME5150 Regression Error, Bias and Variance question and get a clear, step-by-step explanation grounded in how BME5150 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 16 of your The Hong Kong Polytechnic University subjects - and 1,000+ Bibles across every Australian university.
Sia - your BME5150 tutor, unlimited, worked the way the exam marks it
The full 3-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works