Choosing the Right Regularizer for Applied ML: Simulation Benchmarks of Popular Scikit-learn Regularization Frameworks
Abstract
This study surveys the historical development of regularization, tracing its evolution from stepwise regression in the 1960s to recent advancements in formal error control, structured penalties for non-independent features, Bayesian methods, and l0-based regularization (among other techniques). We empirically evaluate the performance of four canonical frameworks -- Ridge, Lasso, ElasticNet, and Post-Lasso OLS -- across 134,400 simulations spanning a 7-dimensional manifold grounded in eight production-grade machine learning models. Our findings demonstrate that for prediction accuracy when the sample-to-feature ratio is sufficient (n/p >= 78), Ridge, Lasso, and ElasticNet are nearly interchangeable. However, we find that Lasso recall is highly fragile under multicollinearity; at high condition numbers (kappa) and low SNR, Lasso recall collapses to 0.18 while ElasticNet maintains 0.93. Consequently, we advise practitioners against using Lasso or Post-Lasso OLS at high kappa with small sample sizes. The analysis concludes with an objective-driven decision guide to assist machine learning engineers in selecting the optimal scikit-learn-supported framework based on observable feature space attributes.
Figures & tables
| LassoCV | Post-Lasso OLS | ElasticNetCV | RidgeCV | |
| Candidate Regularization Parameter Values | Allowed Values for : | |||
| Cross-Validation (CV) | 5-fold ( ); 4-fold ( ); 3-fold ( ); 2-fold ( ) | |||
| Test Set Holdout | 20% | |||
| L1 Ratio Values | n/a | n/a | [0.0, 0.1, 0.5, 0.7, 0.9, 0.95, 0.99, 1.0] | n/a |
| CV Fits per Configuration | 18–45 | 18–45 | 144–360 | 18–45 |
| Hyperparameter | Levels | Values |
|---|---|---|
| Features ( ) | 2 | 64, 128 |
| Rank Ratio ( ) | 2 | 0.9, 1.0 |
| Eigenvalue Dispersion ( ) | 2 | (low), (high) |
| Distribution | 5 | Gamma(0.04), Gamma(0.2), Gamma(1.0), Gamma(5.0), Uniform |
| Sparsity Level | 2 | 0%, 15% |
| Signal-to-Noise Ratio (SNR) | 3 | 0.04, 0.2, 1.0 |
| Parameter | L–R | L–EN | EN–R | Avg |
|---|---|---|---|---|
| Sample Size | 0.549 | 0.284 | 0.091 | 0.308 |
| SNR | 0.117 | 0.058 | 0.021 | 0.065 |
| Distribution | 0.013 | 0.040 | 0.112 | 0.055 |
| Dispersion | 0.022 | 0.016 | 0.001 | 0.013 |
| Features | 0.012 | 0.006 | 0.002 | 0.007 |
| Sparsity | 0.006 | 0.002 | 0.001 | 0.003 |
| Parameter | R–L | EN–L | PL–L | R–EN | PL–EN | R–PL | Avg |
|---|---|---|---|---|---|---|---|
| Distribution | 0.2155 | 0.0773 | 0.0024 | 0.1428 | 0.0024 | 0.0024 | 0.0738 |
| Sample Size | 0.0133 | 0.0031 | 0.0015 | 0.0248 | 0.0015 | 0.0015 | 0.0076 |
| Dispersion | 0.0020 | 0.0099 | 0.0026 | 0.0007 | 0.0026 | 0.0026 | 0.0034 |
| Rank Ratio | 0.0001 | 0.0015 | 0.0027 | 0.0024 | 0.0027 | 0.0027 | 0.0020 |
| SNR | 0.0018 | 0.0010 | 0.0001 | 0.0056 | 0.0001 | 0.0001 | 0.0015 |
| Sparsity | 0.0007 | 0.0004 | 0.0001 | 0.0002 | 0.0001 | 0.0001 | 0.0002 |
| Parameter | R–L | EN–L | PL–L | R–EN | PL–EN | R–PL | Avg |
|---|---|---|---|---|---|---|---|
| Sample Size | 0.0077 | 0.0110 | 0.0893 | 0.0005 | 0.0930 | 0.0800 | 0.0469 |
| Features | 0.0007 | 0.0007 | 0.0047 | 0.0001 | 0.0052 | 0.0047 | 0.0027 |
| Distribution | 0.0068 | 0.0014 | 0.0001 | 0.0051 | 0.0001 | 0.0011 | 0.0024 |
| SNR | 0.0020 | 0.0031 | 0.0032 | 0.0014 | 0.0006 | 0.0014 | 0.0020 |
| Dispersion | 0.0011 | 0.0003 | 0.0007 | 0.0006 | 0.0002 | 0.0001 | 0.0005 |
| Rank Ratio | 0.0001 | 0.0001 | 0.0002 | 0.0001 | 0.0001 | 0.0001 | 0.0001 |
| Observable Regime | Recommendation | Evidence |
|---|---|---|
| , any | ElasticNet (safe default) or Lasso | Figs. C.1–C.3: near-zero F1 at large |
| , high , SNR or k | ElasticNet | Fig. 4: – recall advantage; Figs. C.1, C.3 |
| , high , saturated (SNR ) | Ridge † (EN if genuine selection needed) | Fig. C.2: Ridge EN via recall at very low SNR |
| , low , high | Ridge (competitive F1) † | Figs. C.2, C.3: Ridge wins at small , low SNR |
| , low , all of : low elected AND sparse domain | Lasso is viable | Fig. 4 (low , SNR ): Lasso recall ; EN recall |
| , low , uncertain SNR | ElasticNet (safe default) | EN recall across all SNR at low |
| Observable Regime | Recommendation | Evidence |
|---|---|---|
| , any | Any method (diff. negligible) | Figs. D.1–D.6: near-zero cells at large |
| , high | ElasticNet | Figs. D.3, D.4: 20–40% lower error (sparse); consistent edge over Ridge (dense) |
| , low , sparse | Lasso or ElasticNet | Fig. D.6: Lasso beats Ridge with sparsity |
| , low , dense | Ridge | Fig. D.6: Ridge beats Lasso without sparsity |
| Any , any | Avoid Post-Lasso OLS ‡ | Fig. D.2: higher error across nearly all cells |
| CV-Elected | Likely Regime | Recommended Action |
|---|---|---|
| High / at boundary | Low SNR | Switch to Ridge for all objectives. Lasso recall collapses to 0.18–0.20 in this regime (Fig. 4 ); Ridge outperforms Lasso on F1 (Fig. C.3) and RMSE (Fig. E.4, low-SNR rows). |
| Moderate (e.g., 0.1–10) | Moderate SNR | ElasticNet provides the best risk-adjusted choice across all objectives. |
| Low (e.g., ) | High SNR | Lasso becomes viable if is also low and sparsity is expected. Ridge and ElasticNet remain safe defaults. |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.