Regression is the workhorse of practical ML. Predicting house prices, sales, ad clicks, exam scores — it's all the same trick: find the line (or curve) that best matches your data. In the next 75 minutes, you'll do this by hand, then with scikit-learn.
Start fittingGiven some examples of "input → output", regression finds the best line (or curve) that maps inputs to outputs. Then you use that line to predict outputs for new inputs you haven't seen. That's it. That's the whole game.
15 data points: study hours vs exam score for a real (simulated) class. Your job: drag the amber line endpoints so the line "best matches" all the points. Watch the error (MSE) drop as you get closer.
Grab either endpoint of the amber line and drag. The dashed lines show residuals — the gap between each point and your line. The colored squares show squared errors (the bigger the square, the worse the prediction). Try to minimize the total. When you're satisfied, click "Find best fit" to see what the math computes — and how close you got.
—
You don't need calculus to understand this. Three concepts. That's it.
A line in 2D is defined by two numbers: how steep it is (slope) and where it crosses the y-axis (intercept).
For each point, the error is the gap between actual y and what the line predicts. Square it — so positive and negative errors don't cancel, and big mistakes hurt more than small ones.
Calculus gives you an exact formula. No guessing, no iteration. The optimal m and b can be computed in one shot — which is why linear regression is so fast.
In practice, you never compute regressions by hand. You use scikit-learn — three lines of code, production-ready model. Let's predict house prices from square footage, bedrooms, and age.
"Linear regression" predicts a number. "Logistic regression" predicts a category. Despite the name, logistic regression is the most-used classification algorithm in the world.
How much? How long? How many?
Will they? Is it? Yes or no?
Aim for 4/5. Wrong answers explain themselves.
You fit a line by hand. You watched the math beat you (slightly). You trained a scikit-learn model. You predicted prices on data the model never saw. That's the entire ML loop in 75 minutes. The rest of the course is variations on this theme.
Continue to Module 04