A line that learns from your data.
Place points, watch prediction errors shrink, and see gradient descent improve a straight-line model.
DATA & PREDICTIONS
y = slope × x + interceptŷ = 0.000x + 0.500
Observed dataModel lineResidual error┄ Exact least-squares fit
X and Y use a 0–1 scale. Editing data resets training. Up to 100 points. Use the form for precise or keyboard input.
Ready
EPOCH / POINTS0 / 20
MEAN SQUARED ERROR—
ROOT MEAN SQUARED ERROR—
R² SCORE—
Is the error getting smaller?
Loss is measured after each update. Axes rescale to the history; playback speed changes only the animation rate.
What does the line predict?
Predictions can extend beyond the plotted 0–1 area.
One epoch, three actions.
- Predict: compute ŷ = mx + b for every point.
- Measure: MSE = mean((ŷ − y)²).
- Update: move slope and intercept against the loss gradient.
R² can be negative when the model is worse than predicting the mean. It is undefined when all observed Y values are equal. The dashed reference is the exact least-squares solution, not another training run.