← All lessons
05

Linear Regression

Before neural networks, the simplest way to learn from data: draw a straight line through the points. The line has just two numbers — a slope (how steep) and an intercept (where it starts). Those two numbers are the model.

Drag the two sliders to fit the line to the points. The dashed segments show each point's error — how far the line misses it. Your goal: make the total error as small as possible. This hand-tuning is exactly what training automates, and slope and intercept are exactly a neuron's weight and bias.

error (RMSE): 19.7

Check yourself

If the error is large no matter how you set the sliders, what does that tell you about a straight line as a model for this data?

Go deeper (free): Google ML Crash Course — Linear regression

Next: The Neuron