What Is a Model?
What Is a Model? — A machine learning model is a mathematical function with adjustable parameters that maps inputs to predictions. Training a model means choosing the parameters that best fit observed data.
A machine learning model is just a function — it takes in numbers and spits out a prediction. The trick is finding the function that fits your data best.
- Data points
- Model
- Residuals
Slide from a constant (a flat guess) up to a curve. Watch the residuals shrink as the model gains the flexibility to follow the data.
Slide from a constant (a flat guess) up to a curve. Watch the residuals shrink as the model gains the flexibility to follow the data.
The idea in plain words
A model is a function with adjustable knobs. You feed it an input and it returns a prediction; “training” means turning the knobs until the predictions line up with the data you’ve actually seen. Slide the complexity control: a flat constant can’t follow any trend, a line can follow a slope, and a curve can bend to the data.
A too-simple model leaves a visible, systematic gap — underfitting. How we measure that gap is the job of a loss function, and the simplest useful model is linear regression.
Now, the math
A polynomial model of degree d predicts:
- the model’s predicted output.
- the input feature.
- the coefficients (the knobs) chosen during training.
- the degree — how much the curve can bend.
▸ Show the derivation
For each degree, training picks the coefficients that minimize total squared error — a problem with a clean closed-form solution for polynomials. Degree 0 forces every coefficient except to zero, so the model can only output a single constant, no matter the input.
Now Break It
Try this: Fit a flat horizontal line to clearly curved data — show the systematic error that a too-simple model produces.
Control: Model complexity selector (set to "constant")
Last updated .