Linear Regression
Fit a line, inspect residuals, and see gradient descent reduce squared error.
Linear Regression learns a numeric relationship between inputs and a continuous target. In ModelOrigen you can inspect the line, residuals, gradients, parameter updates, and held-out regression metrics as genuine worker states.
Step by step
- Start with weight and bias.
- Calculate a prediction for each training sample.
- Measure residuals and mean squared error.
- Differentiate the loss to get gradients.
- Update weight and bias with the learning rate.
- Repeat and compare held-out error.
Core formulas
Prediction
ŷ = w·x + bThe learned line converts the input into a numeric prediction.
Mean squared error
MSE = (1/n) Σ(yᵢ − ŷᵢ)²Large prediction errors are penalized more strongly.
Gradient update
θ ← θ − α∇L(θ)The learning rate α controls how far parameters move along the measured gradient.
When to use Linear Regression
- A numeric target is approximately related to the inputs in a linear way.
- You want a transparent baseline with interpretable coefficients.
- You need a simple model before trying more complex regression methods.