Linear Regression Demo
Single-file HTML using PyScript (no Streamlit server)
Python in Browser · PyScript
Model Controls
Model Metrics
Coefficient (slope)
Intercept
R² score
Samples (n)
Underlying true function
We generate synthetic data from:
y = 2·x + 1 + Normal(0, σ²)
and then fit a linear regression model:
ŷ = a·x + b
so you can compare the recovered parameters (a, b) with the true values (2, 1).