Lasso Regression
Linear regression with L1 regularization that drives some coefficients to exactly zero (automatic feature selection)
Linear regression with L1 regularization that drives some coefficients to exactly zero (automatic feature selection).
When to use:
- Have many irrelevant features
- Want automatic feature selection
- Need sparse models (many coefficients = 0)
- Interpretability important
Strengths: Automatic feature selection, creates sparse models, interpretable, prevents overfitting Weaknesses: Drops correlated features arbitrarily, may underperform with many relevant features
Model Parameters
Alpha (default: 1.0) Regularization strength. Higher = more features zeroed out.
- Low (0.01-0.1): Weak selection
- Default (1.0): Moderate selection
- High (10+): Aggressive selection, very few features
Max Iterations (default: 1000) Maximum number of iterations for optimization.
Fit Intercept (default: true) Whether to calculate intercept term.
Selection
- cyclic: Loop through features in order (default)
- random: Random feature selection (can be faster)