Model Results
Regression Equation
Fit Details
Coefficient Analysis
| Feature | Ridge coefficient | OLS coefficient | Shrinkage | Standardised | Penalty contribution |
|---|
Cross-Validation Summary
Observation Results
| # | Actual | Predicted | Residual | Split |
|---|
Step-by-Step Calculation
Formula Used
β̂ = (XᵀX + λI)⁻¹Xᵀy
Ridge regression adds an L2 penalty to least squares. The penalty reduces unstable coefficient sizes. It helps when predictors are strongly correlated.
Lambda controls the amount of coefficient shrinkage. A zero value reproduces ordinary least squares. Larger values create stronger regularisation.
The intercept is normally excluded from regularisation. Standardising features makes the penalty more comparable. Original-scale coefficients remain available.
How to Use
- Enter data manually, paste CSV text, or upload a CSV file.
- Select the target column and confirm every predictor is numeric.
- Choose scaling, solver, validation, and lambda search settings.
- Submit the calculator to fit and compare ridge models.
- Review coefficients, metrics, residuals, charts, and warnings.
- Enter new observations and generate predictions when required.
- Copy, print, or export the completed model results.
Example Data
| Size | Bedrooms | Age | Price |
|---|---|---|---|
| 850 | 2 | 22 | 160000 |
| 1100 | 3 | 18 | 205000 |
| 1450 | 3 | 12 | 255000 |
| 1800 | 4 | 8 | 315000 |
| 2200 | 4 | 5 | 370000 |
Ridge Regression Guidance
Use ridge regression when predictors contain multicollinearity. It trades some bias for lower variance. This often improves unseen-data performance.
Scaling is especially important before applying regularisation. Otherwise large-unit variables receive uneven treatment. Standard scaling is usually appropriate.
Ridge keeps every predictor in the fitted model. Coefficients usually approach zero without becoming exactly zero. Use lasso for automatic feature removal.
Frequently Asked Questions
What does lambda control?
Lambda controls the strength of the L2 penalty. Larger values shrink coefficients more strongly. Validation helps choose a useful value.
Can lambda equal zero?
Yes. Lambda zero gives the ordinary least squares solution. Positive values provide ridge regularisation.
Should predictors be standardised?
Usually yes. Standardisation places predictors on comparable scales. This makes coefficient penalties more balanced.
Does ridge remove features?
Ridge usually keeps every predictor. It reduces coefficient magnitudes rather than forcing exact zeros. Lasso behaves differently.
How is the best lambda selected?
The calculator can compare candidate values using cross-validation. It selects minimum error or one-standard-error results.
What happens with correlated predictors?
Ridge stabilises coefficients when predictors are correlated. It distributes influence across related variables. Predictions may become more reliable.
Why exclude the intercept from the penalty?
The intercept represents the response baseline. Penalising it can shift the entire model unnecessarily. Most implementations leave it unregularised.
Which metric should I inspect?
RMSE is useful for average prediction error. R-squared explains relative variation. Review test metrics and residual patterns together.
Can categorical data be used?
Categorical values must first become numeric indicator columns. Keep one reference level when appropriate. Avoid entering raw category text.