Game setup
Choose a challenge, generate data, then adjust the line.
Interactive regression board
Drag the line or its round handles. Arrow keys make precise changes.
Live performance
Line controls
Error metrics
| Metric | Current line | Best line | Difference |
|---|
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
Import and export
Save results, reuse datasets, or create a printable report.
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₁xResidual: eᵢ = yᵢ − ŷᵢSSE = Σeᵢ²MSE = SSE ÷ nR² = 1 − SSE ÷ SST
Current equation: ŷ = 50.000 + 0.000x
Current dataset
| # | x | Actual y | Predicted ŷ | Residual | Squared error |
|---|
Knowledge check
What does a positive residual mean?
How to use
- Choose a game mode, difficulty, and dataset.
- Drag the line or use slope and intercept controls.
- Watch residuals, error metrics, and Plotly charts update.
- Press Check fit to score your current prediction line.
- 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.