freecoding.school100% FREE · NO SIGNUP
Tensor TownISSUE #12 of 120

linear regression · the simplest model

NeuraVSThe Overfit Ogre
Neura saysLinear regression fits a straight line — the simplest predictor of a continuous value.

It models the target as a weighted sum of features plus a bias (y = w·x + b), fitting the line that minimizes squared error. It's interpretable (each weight is a feature's effect), fast, and a strong baseline. Its limits: it assumes a linear relationship and is sensitive to outliers. Always try it first — beating a simple baseline is the bar for a complex model.

Power-ups you unlock

The Overfit Ogre attacks — common mistakes

Boss battleExplain what each weight in a linear model represents.

Example code

<!doctype html><html><head><meta charset="utf-8"></head>
<body style="background:#06040d;color:#e6e0ff;font-family:monospace;padding:20px"><pre>price = w1·area + w2·beds + b
each w = that feature’s effect on price
baseline first → then beat it</pre></body></html>
▶ Open the interactive comic issue
‹ Dimensionality Reduction · Pca · T-Sne · UmapLogistic Regression · Binary Classifier ›