← Retour à l'Académie
A student aligns two rulers along adjacent sides of a rust-coloured fabric rectangle while an instructor holds it steady on a cutting table.
Connaissances IAFondamental5 nov. 2026· 3 min

Polynomial Features and Interactions

Polynomial features let a linear estimator model curves and products of inputs. A worked rectangle example shows how an interaction term captures area, while squared terms capture curvature, with cautions about complexity and extrapolation.

polynomial featuresinteraction termslinear models

Sources

Résumé complet

A linear estimator adds up weighted inputs. That sounds too rigid to describe a rectangle, whose area is length times width. Suppose a class measures rectangles and records length L and width W in metres. Area is A = L × W square metres. Hand the estimator the inputs L, W and a new column L·W, and it can write A = 0·L + 0·W + 1·(L·W). The weights on length and width are zero and the weight on the product is one. The model stays linear in its weights, but the transformed input carries the multiplication. That new column is an interaction term, and it says the effect of length on area depends on width.

A squared term is different. Give the estimator L and L² and it can fit a curve such as area against the side of a square, A = L². Here one input meets itself. There is no second variable, so the term describes curvature, not a partnership between two measurements. In a model with L and W, the columns L², L·W and W² answer three separate questions. Does area bend as length grows at fixed width? Does the pair matter jointly? Does area bend as width grows at fixed length? Mixing them up produces confident but wrong stories about which measurement drives the outcome.

Complexity grows quickly. With two inputs at degree two, the transformed set is 1, L, W, L², L·W and W², six columns including the constant. Three inputs give ten columns. Ten inputs give sixty-six. Each added column is another weight to estimate, so small datasets support only modest expansions. A useful check is to count rows against columns before fitting. If a class has twenty rectangles and sixty-six columns, the fit has more freedom than evidence, and agreement with the training table tells you little about new rectangles.

Extrapolation deserves equal care. A fitted curve can pass neatly through the observed lengths and widths, then swing wildly outside their range. Area remains L × W everywhere, but a flexible model has no reason to stay sensible beyond the data it saw. Ask what the model predicts for a rectangle 20 m long when the widest observed length is 8 m. A strange answer is a warning about the model, not a discovery about rectangles.

Including a feature does not force its coefficient to help. If L·W adds nothing beyond L and W in a particular dataset, a fitted weight near zero is a reasonable outcome. A large weight is not a promise of better predictions. Regularisation can shrink weights, and correlated columns can split credit unpredictably. The honest question is whether the extra column improves performance on data the model has not seen.

Try this activity. Give pairs a table of hypothetical rectangles with lengths from 2 m to 8 m and widths from 1 m to 5 m, plus computed areas. Ask them to predict area for an unseen rectangle using only L and W, then with L·W added. Students write their reasoning on a shared sheet and compare coefficients. Ask one pair to explain why the product column earned most of the weight. The written explanations make their thinking visible, and the comparison shows how a transformed input can carry a relationship that plain addition cannot.