Besley’s Lab
← All labs

Interactive notebook

Linear vs. Logistic

The same machinery predicting a number versus predicting a probability.

Use the arrow keys to move the crosshair. Press Enter or Space to add a point or select the nearest point. Arrow keys move a selected point. Delete removes it; Escape releases it. Hold Shift with an arrow key for a larger move.
fit y = 0.519x + 0.723 0.673MSE 0.805points 16
  • Least-squares fit
  • Residuals

Drop an outlier far from the line and watch the whole fit tilt toward it — squared error punishes big misses disproportionately.

The plot supports pointer dragging and keyboard editing. Linear regression minimizes the sum of the squared dashed residuals. Squaring is what makes it solvable in closed form — and also what makes it fragile: one point twice as far away contributes four times the error, so outliers get a vote far larger than their share.