Language: English
Last updated: 2026-04-17
This page: Model documentation
Switch: Chinese
Language switch: Chinese
Lasso provides L1-regularized linear regression with selectable CPU/GPU solvers and inference backends. It targets sparse feature selection while preserving a familiar estimator interface.
statgpu.linear_model.Lasso
Estimate
$$
\min_{\beta}\frac{1}{2n}|y - X\beta|_2^2 + \alpha|\beta|_1
$$
with iterative optimization (fista, admm, or coordinate descent depending on backend configuration).
The model is solved by iterative optimization rather than a closed-form normal equation. Stopping can be based on coefficient change (coef_delta) or KKT consistency (kkt), depending on stopping.
inference_method="cpu_ols_inference": CPU-side OLS-style post-selection inference surface.inference_method="gpu_ols_inference": GPU-side inference path to reduce host/device transfer overhead.inference_method="debiased": de-biased (de-sparsified) Lasso inference with z-statistic semantics.inference_method="bootstrap": residual bootstrap; typically more robust and slower.compute_inference=Trueenables_bse,_tvalues,_pvalues,_conf_int.- Legacy aliases are accepted:
naive_ols -> cpu_ols_inference,gpu_naive_ols -> gpu_ols_inference.
Validity notes:
cpu_ols_inference/gpu_ols_inferenceintervals are heuristic post-selection intervals and should not be interpreted as valid selective-inference confidence intervals.- The current
debiasedimplementation returns per-coefficient marginal confidence intervals only; simultaneous/joint coverage is not guaranteed.
| Parameter | Default | Description |
|---|---|---|
alpha |
1.0 |
L1 regularization strength |
solver |
"fista" |
GPU solver: fista / admm |
cpu_solver |
"coordinate_descent" |
CPU solver: coordinate_descent / fista |
stopping |
"coef_delta" |
Stopping rule: coef_delta / kkt |
inference_method |
"cpu_ols_inference" |
cpu_ols_inference / gpu_ols_inference / debiased / bootstrap |
compute_inference |
True |
Whether to compute inference stats |
enable_simultaneous_inference |
False |
Enable simultaneous inference (debiased only) |
simultaneous_method |
"maxz_bootstrap" |
Currently only maxz_bootstrap is supported |
simultaneous_alpha |
0.05 |
Simultaneous coverage level parameter |
simultaneous_n_bootstrap |
1000 |
Number of multiplier-bootstrap draws for max- |
simultaneous_random_state |
None |
RNG seed for simultaneous bootstrap |
simultaneous_include_intercept |
False |
Whether the simultaneous target set includes intercept |
gpu_memory_cleanup |
False |
Best-effort CuPy pool cleanup after each fit |
from statgpu.linear_model import Lasso
# CPU
m_cpu = Lasso(alpha=0.1, device="cpu", cpu_solver="coordinate_descent", stopping="kkt")
m_cpu.fit(X, y)
# GPU
m_gpu = Lasso(
alpha=0.1,
device="cuda",
solver="fista",
stopping="kkt",
inference_method="gpu_ols_inference",
gpu_memory_cleanup=True,
)
m_gpu.fit(X, y)Simultaneous inference example (supports device="cpu" and device="cuda", with device-consistent computation):
m_sim = Lasso(
alpha=0.1,
device="cpu",
inference_method="debiased",
enable_simultaneous_inference=True,
simultaneous_method="maxz_bootstrap",
simultaneous_alpha=0.05,
simultaneous_n_bootstrap=1000,
simultaneous_random_state=7,
)
m_sim.fit(X, y)
ci_marginal = m_sim._conf_int
ci_simul = m_sim._conf_int_simultaneousdebiased is the strict mainline inference path for high-dimensional statistical inference. cpu_ols_inference and gpu_ols_inference are lighter approximate paths for engineering throughput, while bootstrap is usually more robust but materially slower.
- Coefficients:
intercept_,coef_,n_iter_ - Inference (if enabled):
_bse,_tvalues,_pvalues,_conf_int - Under
inference_method="debiased", summary/statistical reporting uses z-style semantics (z,P>|z|), and_conf_intis marginal per coefficient. - With simultaneous inference enabled,
_conf_int_simultaneousstores joint intervals over the configured target set (maxz_bootstrap). - Methods:
fit,predict,score,summary - Common diagnostics include
aicandbicwhen available.
- Why can CPU and GPU iteration counts differ under the same
tol? Different solvers and numeric paths converge differently; compare under fixedsolverandstopping. - When should I use
gpu_ols_inference? Prefer it for larger GPU-trained workloads to reduce transfer overhead. - When should I use
debiased? Prefer it when you need inferential quantities (SE/p-values/intervals) in high-dimensional sparse settings. - Are
cpu_ols_inference/gpu_ols_inferenceintervals statistically valid confidence intervals? Not in a strict selective-inference sense; treat them as engineering diagnostics. - Are
debiasedintervals simultaneous/joint confidence regions? No. They are currently marginal per-coefficient intervals. - How do I enable simultaneous intervals? Set
enable_simultaneous_inference=Truewithinference_method="debiased"andsimultaneous_method="maxz_bootstrap".
dev/benchmarks/benchmark_lasso_inference_gpu_vs_cpu.pydev/benchmarks/benchmark_lasso_cpu_gpu_tol.pydev/comparisons/compare_lasso_kkt_stopping.pydev/tests/test_lasso_debiased_inference.py
- Tibshirani, R. (1996). Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B, 58(1), 267-288. https://doi.org/10.1111/j.2517-6161.1996.tb02080.x
- Buhlmann, P., & van de Geer, S. (2011). Statistics for High-Dimensional Data. Springer.
- Zhang, C.-H., & Zhang, S. S. (2014). Confidence intervals for low-dimensional parameters in high-dimensional linear models. Journal of the Royal Statistical Society: Series B, 76(1), 217-242. https://doi.org/10.1111/rssb.12026
- Javanmard, A., & Montanari, A. (2014). Confidence intervals and hypothesis testing for high-dimensional regression. Journal of Machine Learning Research, 15, 2869-2909. https://jmlr.org/papers/v15/javanmard14a.html