Linear Regression Demo
Single-file HTML (PyScript + NumPy + Plotly)
No Streamlit · No iframe
Model Controls
Model Metrics
Coefficient (slope)
Intercept
R² score
Samples (n)
True model
True function:
y = 2·x + 1 + ε
Estimated model:
ŷ = a·x + b
Compare (a, b) with (2, 1) and see how noise & number of points affect R².