How it works
A linear model combines input features with weights and a bias. Training chooses parameters that reduce a loss, such as mean squared error, on observed examples.
A concrete example
For a toy dataset with inputs 1, 2, 3 and targets 2, 4, 6, a line y = 2x fits all three observations exactly.
Watch for this
A low training error does not prove a model will generalize. Evaluate on held-out examples and check for leakage.
Try it yourself
Change the slope and find the smallest mean squared error for the toy dataset.