Your First Model: Linear Regression
Linear regression is usually the first model anyone learns, and for good reason: it's simple enough to compute by hand on paper, yet it demonstrates the entire "learning loop" from Module 3 concretely.
The model
Linear regression assumes the relationship between an input and an output can be approximated by a straight line:
(the slope) and (the intercept) are the model's parameters — the numbers that get adjusted during training. Everything the model "knows" after training is stored in just these two numbers.
Measuring how wrong the line is
For any candidate line, you can measure how well it fits the data by computing the error at each point (actual y minus predicted y), squaring it (so positive and negative errors don't cancel out, and big misses are punished more), and averaging across all points. This is called the Mean Squared Error (MSE), and it's a specific example of a loss function — a number that says "how wrong is the model right now?" Training a model is, mechanically, the process of searching for parameters that make the loss as small as possible.
Beyond one input
Real problems usually have many features, not just one. Multiple linear regression extends the same idea: . If that formula looks familiar, it should — it's a dot product between a weight vector and a feature vector, plus a bias, which is exactly the formula for a single artificial neuron you'll see in Module 7.