DeepLLM Quiz
Machine Learning

Basis functions: how a linear model learns curves

10 questions on linear regression, basis functions, the bias term, hand-made features versus learned ones and the single-layer network view.

  • 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

    A model uses bell-shaped bumps, placed at chosen points along the input range, as basis functions. Must the bumps be normalised so that they can be read as probabilities?

    • No: the scale doesn't matter because each bump is multiplied by a learnable weight anyway
    • Yes, otherwise the model can't be trained
    • Yes, because they have to add up to one
  2. Sample 2

    How do sine-and-cosine basis functions differ from bump-shaped, localised ones?

    • They can only be used with images
    • They are always more accurate
    • Each wave represents a single frequency and extends over the whole input space, whereas localised functions mix several frequencies

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

Linear regression has a reputation for being the simplest model in machine learning, and in its barest form it is: predict a number as a weighted sum of the inputs. Such a model can only represent straight lines, flat planes and their higher-dimensional cousins, which is a severe limit when the real relationship between inputs and the quantity to predict curves, bends or saturates. A single idea removes most of that limit: instead of feeding the raw inputs into the weighted sum, feed in fixed nonlinear functions of them, called basis functions.

This quiz explains that idea and its consequences in plain language. You will see why a model built from basis functions can follow curves and still count as linear, what that linearity buys in terms of analysis and computation, and what it costs. You will meet the extra constant term that lets a model shift its output up or down, often called the bias, and learn why that word has nothing to do with statistical bias. You will also look at the usual families of basis functions: powers of the input, bell-shaped bumps placed along the input range, smooth S-shaped curves, and waves.

A central theme is where the basis functions come from. Before deep learning, engineers designed them by hand, in a process known as feature extraction, and the quality of the whole system rested on that design. The quiz asks why hand-crafting is so hard and how deep learning changes the arrangement by learning the nonlinear transformation from the data itself. It finishes with a picture that links the topic to what follows: a linear model with basis functions is exactly a neural network with a single layer of adjustable weights.

Common misunderstandings are worth testing. People think that «linear» means that the fitted function must be a straight line, that basis functions need to be Gaussian or probabilistic in any sense, or that the choice of basis does not matter. Another is to think that deep learning needs no features at all, when in fact it learns them. Understanding this one idea makes it much easier to read about kernel methods, neural networks and many other techniques, since they differ mainly in how the features are produced and in how the weights are fitted. Because only the weights are learned, the behaviour of such a model is easy to inspect, which is one reason it remains a common baseline against which more complicated models are measured.

The quiz suits students meeting regression for the first time and practitioners who want a clear view of how classical models relate to neural networks. No mathematics beyond a weighted sum is needed. There are 10 questions, each with an explanation shown straight after you answer, and the quiz 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 regression is calculated?

No. The quiz is about the structure of the model, not about how its weights are computed. It uses pictures and everyday examples, and each question can be answered by thinking about what kinds of curves a given model can follow.

›What is a basis function?

A basis function is a fixed function of the input, chosen in advance, whose value is used as one of the ingredients of the model. The model's prediction is a weighted sum of these ingredients, and training only adjusts the weights. By choosing curved functions, you can make the prediction curved while keeping the training problem simple.

›Why is the model still called linear?

Because the prediction is a straight combination of the adjustable parameters, which multiply the basis functions and are added up. Linear in this sense does not mean that the prediction is a straight line in the input. This property is what makes the mathematics of fitting these models so tractable.

›What is the bias parameter, and is it related to bias in statistics?

The bias parameter is a constant offset that lets the prediction shift up or down regardless of the inputs. It is often treated as the weight of an extra basis function that always equals one. It is unrelated to statistical bias, which describes a systematic error in an estimate.

›What is feature extraction?

It is the fixed preprocessing of raw inputs into more useful quantities before they enter a simple model. Skilled engineers spent a great deal of effort on it. It is difficult to do well for anything but the simplest problems, which is one of the problems that deep learning addressed.

›How do basis functions relate to neural networks?

A linear model with basis functions can be drawn as a network with one layer of adjustable weights joining the basis functions to the output. A deep network goes further by learning the basis functions themselves, through additional layers of weights, instead of fixing them in advance.

›Which kinds of basis function are common?

Powers of the input give polynomials. Bell-shaped bumps centred at chosen locations give localised models. S-shaped curves give sigmoid models, and sines and cosines give Fourier models. Wavelets are localised in both position and frequency. The best choice depends on the problem, and the later parts of the story don't depend on which is used. In practice, a quick way to choose is to ask what the data look like: smooth global trends suggest powers or waves, local bumps suggest localised functions, and signals sampled on a regular grid, such as images or audio, suit wavelets.

More quizzes