Polynomial Features

A straight line cannot describe every relationship between our measurements and the answer. Adding features such as an input squared gives the model more to work with while keeping its coefficients straightforward to fit.

13 sections · 10 questions · 4 coding challenges

1 / 13

Could a Straight-Line Calculation Describe a Curve?

BOTIE

Measured relationships do not always change at a constant rate. An instrument's response may grow more quickly at larger inputs, so a straight line leaves a systematic pattern in its errors. We need more flexibility, but we would like to retain a fitting method we understand.

Least squares soon became a tool for fitting more than straight lines. Gergonne's 1815 work applied it to polynomial interpolation, connecting the selection of a formula with the way observations were taken. The coefficients could still be estimated through linear equations even though the resulting curve was not straight.

The key is to create extra measurements from an existing input: its square, its cube, or other chosen powers. We fit a coefficient for each. The model remains linear in those coefficients, while the prediction can curve as the original input changes. Each extra term buys flexibility, so we also have to check whether it describes a repeatable pattern or just follows noise.

Sources for this history