Formula Used
Lasso objective:
(1 ÷ 2n) × Σ(yᵢ − ŷᵢ)² + λ × Σ|βⱼ|
Larger lambda values shrink more coefficients toward zero.
How to Use
- Paste data with predictors and one target column.
- Name the target and optional predictor columns.
- Choose a calculation mode and lambda settings.
- Adjust validation, standardisation, and solver controls.
- Add new rows for optional predictions.
- Calculate, inspect diagnostics, then export results.
Example Data
| size | bedrooms | age | distance | price |
|---|---|---|---|---|
| 1200 | 2 | 18 | 8.2 | 215000 |
| 1750 | 4 | 8 | 4.8 | 342000 |
| 2250 | 5 | 3 | 2.7 | 472000 |
Frequently Asked Questions
What does Lasso regression do?
It fits regression while shrinking coefficients. Some coefficients become exactly zero. This performs automatic feature selection.
What does lambda control?
Lambda controls regularisation strength. Larger values increase coefficient shrinkage. Excessive values may cause underfitting.
Why standardise predictors?
Predictors may use different scales. Standardisation makes penalties more comparable. It usually improves feature selection.
What means a zero coefficient?
The model excluded that predictor. Its estimated contribution becomes zero. Another lambda may select it.
How is lambda selected automatically?
Cross-validation tests many lambda values. Validation errors identify the best setting. The one-standard-error rule favours simplicity.
How does Lasso differ from Ridge?
Lasso can create zero coefficients. Ridge usually keeps every predictor. Both reduce overfitting through regularisation.
What happens with correlated predictors?
Lasso may select one correlated predictor. Similar predictors can receive unstable choices. Elastic Net often handles groups better.
Can Lasso make new predictions?
Yes, after fitting the model. Enter values in feature order. The calculator shows predictions and contributions.
Is adjusted R-squared always suitable?
It was designed for ordinary regression. Penalised models require careful interpretation. Cross-validation metrics are usually stronger evidence.