DeepLLM Quiz
Machine Learning

Fitting curves: model complexity and regularisation

10 questions on fitting a curve to noisy data, model complexity, large coefficients, penalties and hyperparameters. With explanations.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    Which score lets you compare the fit on a small data set and on a large one, in the same units as the quantity you predict?

    • The sum of squared errors, as it is
    • The largest single error
    • The root-mean-square error: divide by the number of points, then take the square root
  2. Sample 2

    A high-order model overfits a small data set. What usually happens if you collect much more data for the same model?

    • Overfitting becomes less severe, because the extra points pin the curve down
    • Overfitting gets worse, because there is more noise to memorise
    • Nothing changes, because the model order decides everything

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

Fit a curve through ten points on a graph. With a straight line, the fit is poor. With a gently bending curve, it looks about right. With a wildly flexible curve you can hit every single point exactly, and the result looks like a rollercoaster that no sensible person would trust. This tiny experiment contains most of what you need to know about why machine learning models fail on new data, and it is the best way to build a feel for the ideas before they appear in bigger models. The same pattern, a model that looks brilliant on familiar data and unreliable on anything new, appears in image recognisers, forecasting tools and language models, only with millions of coefficients instead of ten.

The quiz follows that experiment step by step. It starts with the data: a hidden pattern with random noise on top, which is how most real measurements behave. It then looks at the simplest family of models, ones that are linear in their adjustable coefficients even when they are curved in the input, and at the usual way of scoring a fit, by adding up the squared gaps between predictions and targets. You will see why that score can reach zero and still be a terrible sign.

Next come the questions that matter in practice. What happens to the coefficients as a model becomes more flexible? Why does a model that contains all the simpler ones as special cases sometimes do worse than they do? How does adding more data change the picture? And what exactly does a penalty on large coefficients do, and what goes wrong if you make it too strong? The last part turns to the settings of a model that you cannot learn from the training data alone, and to the practical tools for choosing them, including holding data back and rotating which part is held back.

Common mistakes in this area are easy to spot once you have seen the experiment. People judge a model by its error on the data it was fitted to. They assume more flexibility is always at least as good. They tune a penalty by minimising the very error the penalty is meant to control. And they forget that « more parameters than data » is not automatically a disaster in modern models, which is one reason why the old rules of thumb need care.

The quiz suits students meeting regression for the first time and practitioners who want to sharpen their intuition. It is separate from the general quiz on overfitting and evaluation: here the focus is on curves, coefficients and penalties. There are 10 questions, each with an explanation, and it takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation appears after every answer.

›Do I need to know how to fit a curve myself?

No. The quiz describes each situation in words, and the questions ask what you would expect to happen. If you have ever drawn a line or a smooth curve through points on a graph, you already have the right picture.

›What does it mean for a model to be linear in its parameters?

It means the prediction is built by multiplying each adjustable number by something and adding the results. The things being multiplied can be curved functions of the input, such as its square or its cube, so a model like this can follow curves. The adjustable numbers themselves only ever appear in a straight, additive way.

›Why is overfitting a problem even when the training error is tiny?

Training error measures how well the model reproduces the examples it was shown, including their random noise. A very flexible model can reproduce the noise as well as the pattern, so it looks perfect on old data and behaves erratically between the points and on new inputs. What matters is the error on data it has not seen.

›What is regularisation?

It is a way of discouraging a model from becoming more complicated than the data justifies. In the curve-fitting case, a penalty is added to the error that grows with the size of the coefficients, so the fit has to trade accuracy against simplicity. A single number controls how strongly the penalty counts.

›What is a hyperparameter?

A hyperparameter is a setting that shapes the model or the training but is not learned from the training data in the usual way. The order of a polynomial and the strength of a penalty are examples. Because the training error always prefers the most flexible, least penalised option, such settings have to be chosen using other data. A common arrangement is to fit the coefficients on one part of the data and compare the candidate settings on another part that the fitting never touched.

›What is cross-validation, and when is it worth the effort?

Cross-validation splits the data into several groups. Each group takes a turn as the held-back part while the model is trained on the rest, and the scores are averaged. It is most useful when data is scarce, because every example is used for both training and checking. The cost is that you must train the model several times.

›Is a model with more parameters than data points always doomed?

Not in modern deep learning, where very large models trained on large data sets can generalise well. In classical statistics, a rule of thumb asks for several times more data points than parameters. That rule is a useful warning for simple models, but it is not a law for every kind of model.

More quizzes