Model Fit (Intuition) Examples in Math

Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Model Fit (Intuition).

This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Math.

Concept Recap

Model fit describes how closely a statistical model's predictions match the observed data โ€” measured by residuals, R2R^2, or loss functions.

Does the model's predictions match reality? Good fit = close match.

Read the full concept explanation โ†’

How to Use These Examples

  • Read the first worked example with the solution open so the structure is clear.
  • Try the practice problems before revealing each solution.
  • Use the related concepts and background knowledge badges if you feel stuck.

What to Focus On

Core idea: Model fit measures how well a model's predictions match the data it is supposed to describe.

Common stuck point: The procedure for model fit (intuition) is the easy part; the trap is judging fit only on the data used to build the model. Asking "Am I comparing a model's predicted values to the actual observed values to judge the gap?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Sense of Study hint: Ask: Am I comparing a model's predicted values to the actual observed values to judge the gap?

Worked Examples

Example 1

easy
A scatter plot of weight vs. height shows points loosely scattered around a line. Two measures of fit are given: R2=0.65R^2 = 0.65 and residuals with SD = 8 kg. Interpret both measures.

Answer

R2=0.65R^2=0.65 means 65% explained; residual SD=8 kg means typical error is ยฑ8 kg. Moderate fit.

First step

1
R2=0.65R^2 = 0.65: the linear model explains 65% of the variability in weight โ€” moderate fit

Full solution

  1. 2
    Residual SD = 8 kg: typical prediction error is ยฑ8 kg โ€” individual predictions could be 8 kg off on average
  2. 3
    Combining: the model captures most weight variation but not all; 35% of variation remains unexplained
  3. 4
    Assessment: moderate fit โ€” useful for general trends, but not precise enough for individual weight prediction
Model fit has two complementary measures: R2R^2 (proportion of variation explained) and residual SD (typical prediction error in original units). Both are needed: high R2R^2 with large residual SD can still mean poor practical predictions.

Example 2

medium
Residual plot for a linear model shows a clear U-shaped pattern. What does this indicate about the model, and what should be done?

Example 3

medium
Observations {4,6,9,12}\{4, 6, 9, 12\}, predictions {5,7,8,10}\{5, 7, 8, 10\}. Compute the sum of squared residuals.

Example 4

medium
Model A: train R2=0.85R^2=0.85, test R2=0.80R^2=0.80. Model B: train R2=0.99R^2=0.99, test R2=0.50R^2=0.50. Which generalizes better?

Example 5

hard
A high-degree polynomial passes through every training point but oscillates wildly between them. Diagnose and prescribe.

Practice Problems

Try these problems on your own first, then open the solution to compare your method.

Example 1

easy
Three models have R2R^2 values: Model A = 0.95, Model B = 0.50, Model C = 0.10. Rank them by goodness of fit and describe what each R2R^2 means.

Example 2

hard
A model has R2=0.99R^2 = 0.99 in-sample but shows a fanning residual plot (residuals grow larger as y^\hat{y} increases). What problem does this reveal, and what are its consequences?

Example 3

easy
Model fit measures how closely a model's predictions match the ___.

Example 4

easy
A residual is the difference between the observed value and the ___ value.

Example 5

easy
Observed y=12y=12, predicted y^=9\hat{y}=9. What is the residual?

Example 6

easy
An R2R^2 of 1.0 means the model explains what fraction of the variation?

Example 7

easy
Smaller residuals overall indicate a ___ fit.

Example 8

easy
To check fit beyond a single number, you should also examine the ___ plot.

Example 9

easy
A model fits the training data closely but predicts new data poorly. Good fit or misleading fit?

Example 10

easy
Sum of squared residuals for a model is 0. What does that say about the in-sample fit?

Example 11

medium
Data: observed {4,6,9}\{4, 6, 9\}, predicted {5,5,8}\{5, 5, 8\}. Compute the sum of squared residuals.

Example 12

medium
A residual plot shows a clear U-shape (curve). What does this tell you about a linear model's fit?

Example 13

medium
Model A has R2=0.95R^2=0.95 with patternless residuals; Model B has R2=0.95R^2=0.95 with strongly patterned residuals. Which fits better?

Example 14

medium
Why can adding more predictors always increase (or not decrease) R2R^2 on training data?

Example 15

medium
A model has training R2=0.99R^2=0.99 but test R2=0.40R^2=0.40. What does the gap indicate?

Example 16

medium
If a model's residuals have a clear funnel shape (spread grows with xx), what assumption is violated?

Example 17

medium
Two models: simple line with test error 5, complex curve with test error 8. On generalization, which fits better?

Example 18

medium
Observed values {10,12,15}\{10, 12, 15\}, predictions {11,11,16}\{11, 11, 16\}. Compute the mean absolute residual.

Example 19

medium
A model's R2R^2 is 0.0. What does this say about how well it explains the variation in yy?

Example 20

challenge
Data (1,2),(2,4),(3,6)(1,2),(2,4),(3,6) with model y^=2x\hat{y}=2x. Compute SSR, then R2R^2 given total sum of squares (about the mean 4) is 8.

Example 21

challenge
A model has training error 2 and test error 2.5; another has training error 0.5 and test error 6. Which generalizes better and what does the second's gap signal?

Example 22

challenge
With data points (x,y)(x,y): (1,3),(2,5)(1,3),(2,5) and model y^=ax+b\hat{y}=a x + b, find a,ba,b giving a perfect fit, and state the SSR.

Example 23

easy
A model has R2=0.80R^2 = 0.80. What does this mean?

Example 24

easy
Observations {3,5,8}\{3, 5, 8\}, predictions {4,5,7}\{4, 5, 7\}. Find the residuals.

Example 25

easy
R2=0.05R^2 = 0.05 โ€” interpret.

Example 26

easy
Compute the mean absolute residual for residuals {2,โˆ’1,3,โˆ’4}\{2, -1, 3, -4\}.

Example 27

medium
R2=0.97R^2 = 0.97 on training but R2=0.42R^2 = 0.42 on test. What does this gap indicate?

Example 28

medium
A scatter plot shows points clustered tightly along a curve, but the linear model's R2=0.30R^2 = 0.30. What does this say?

Example 29

medium
A residual plot widens to the right (fan shape). What is violated?

Example 30

medium
Observations {2,4,7,10}\{2, 4, 7, 10\}, predictions {3,5,6,9}\{3, 5, 6, 9\}. Compute the residual sum of squares (SSR) and mean absolute residual (MAR).

Example 31

medium
A model has R2=0.99R^2 = 0.99 on a dataset of 55 points using 44 parameters. Why is high R2R^2 here uninformative?

Example 32

medium
Adding an irrelevant predictor: what happens to training R2R^2? To adjusted R2R^2?

Example 33

medium
Cross-validation gives RMSE =5= 5 for Model 1 and RMSE =8= 8 for Model 2. Which generalizes better?

Example 34

hard
Data (1,3),(2,5),(3,7)(1, 3), (2, 5), (3, 7) with model y^=2x+1\hat{y} = 2x + 1. Compute SSR and R2R^2 (mean of yy is 55, SST is 88).

Example 35

hard
Data (1,2),(2,5),(3,7)(1, 2), (2, 5), (3, 7) with model y^=2.5x\hat{y} = 2.5 x. Compute SSR.

Example 36

hard
Why can R2R^2 be negative when comparing a model against the mean baseline?

Example 37

hard
A residual plot shows residuals systematically positive for low y^\hat{y} and negative for high y^\hat{y}. What does this hint at?

Example 38

challenge
You have n=20n=20 points and fit a polynomial of degree 1919. Predict the training R2R^2 and explain why test R2R^2 will be catastrophic.

Example 39

challenge
Two models tie on training R2R^2 at 0.900.90. Model A uses 33 predictors; Model B uses 1010. Which would you pick and why?

Background Knowledge

These ideas may be useful before you work through the harder examples.

correlationprediction