Regression Line Builder Game

Drag, tune, and test regression lines while residuals, scores, hints, challenges, and Plotly charts reveal how accurate predictions improve through practice today for everyone.

Game setup

Choose a challenge, generate data, then adjust the line.

Use one x,y pair per line. A header row is optional.
Drop a CSV file here
The first two numeric columns become x and y.

Interactive regression board

Drag the line or its round handles. Arrow keys make precise changes.

☆☆☆
Level 1 Mode Free build
Target Status Ready
Accuracy meter0%

Live performance

Score0points
Time0:00elapsed
Moves0unlimited
Accuracy0%relative fit

Line controls

Keyboard: adjust slope, move line.

Error metrics

MetricCurrent lineBest lineDifference

Display options

Plotly analysis dashboard

Inspect residuals, error distribution, prediction agreement, and learning progress.

Progress and achievements

  • Best score0
  • Lowest MSE
  • Levels completed0
  • Average score0
  • Current streak0

Achievement badges

No badges yet

Import and export

Save results, reuse datasets, or create a printable report.

Exports include slope, intercept, metrics, score, and dataset values.

Guided tutorial

1. Read the scatter pattern

Look for the overall direction. Rising points suggest a positive slope.

2. Set the slope

Rotate the line until it follows the main direction of the points.

3. Set the intercept

Move the line upward or downward so residuals balance around zero.

4. Inspect residuals

Shorter vertical residual lines usually indicate better predictions.

5. Compare with least squares

The optimal line minimizes the sum of squared vertical errors.

Formula used

Prediction: ŷ = b₀ + b₁x
Residual: eᵢ = yᵢ − ŷᵢ
SSE = Σeᵢ²
MSE = SSE ÷ n
R² = 1 − SSE ÷ SST

Current equation: ŷ = 50.000 + 0.000x

Current dataset

#xActual yPredicted ŷResidualSquared error

Knowledge check

What does a positive residual mean?

Choose an answer.

How to use

  1. Choose a game mode, difficulty, and dataset.
  2. Drag the line or use slope and intercept controls.
  3. Watch residuals, error metrics, and Plotly charts update.
  4. Press Check fit to score your current prediction line.
  5. Complete the target and continue to harder levels.

Frequently asked questions

What is a regression line?

It summarizes a linear relationship between x and y. The line predicts y from each x value.

What is a residual?

A residual is actual y minus predicted y. Positive residuals appear above the fitted line.

Why square errors?

Squaring prevents positive and negative residuals from cancelling. It also penalizes large misses more strongly.

What does R-squared show?

R-squared estimates how much variation the line explains. Values closer to one usually indicate stronger fit.

Do outliers matter?

Yes. Extreme points can pull a least-squares line toward themselves and increase error elsewhere.

Can nonlinear data have a poor line?

Yes. A line may miss curved structure even when a visible relationship exists.

Is correlation the same as causation?

No. A fitted relationship does not prove that one variable causes the other.

How is the best line calculated?

The game uses ordinary least squares. It minimizes the sum of squared vertical residuals.

Can I use my own data?

Yes. Enter points manually or import a CSV file containing at least two numeric columns.

Related Calculators

House Price PredictorCar Price EstimatorTemperature Prediction GameStudent Score PredictorDelivery Time EstimatorCrop Yield PredictorEnergy Consumption ChallengeTaxi Fare PredictorSales Forecast Game

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.