Lasso Safe Screening for Feature Elimination
Lasso promotes sparsity in machine learning, statistics, and signal processing but can be computationally expensive. Safe screening mitigates this by identifying zero coefficients early, reducing memory and computation. This post explores its mathematical foundation and compares two state-of-the-art techniques: GAP and RYU ball screening.
1. Lasso problem
Given a feature matrix and a response vector , the Lasso problem is
where controls sparsity. Large encourages more zero entries in .
2. Lasso Dual Problem
The dual problem of Lasso with variable :
subject to the constraint:
Note that for some given , we can construct a feasible dual variable using Dual Scaling
Note that satisfies
where and be any optimal solution of Lasso and its dual problem, and that the convergence of Dual Gap holds
Here the dual gap is defined as the different between the objective value of lasso and the objective value of its dual.
3. KKT Optimality Condition
The KKT optimality condition ensures the following Complementary Slackness condition between and :
where is the -th column of .
4. Safe Screening Rule
From the Complementary Slackness condition, we have the Safe Screening rule
Since is unknown, above screening rule is useless. We now relax this rule by finding a Safe Ball, i.e. a ball containing .
The popular choice is GAP ball [1] with center and radius defined as
The subset of GAP ball is RYU ball [2] (leading to more efficient screening)
where .
Now, the safe screening reads as follows
5. Experiment
Here, we compare the safe screening performance of GAP and RYU ball.
The result confirms that using RYU can screening more features than using GAP ball.
The code is in Python, available on my github [3]




6. References
[1]. Fercoq, Olivier, Alexandre Gramfort, and Joseph Salmon. “Mind the duality gap: safer rules for the lasso.” International conference on machine learning. PMLR, 2015.
[2]. Tran, Thu-Le, et al. “ONE TO BEAT THEM ALL:” RYU"-A UNIFYING FRAMEWORK FOR THE CONSTRUCTION OF SAFE BALLS." (2023).
[3]. https://github.com/Tran-Thu-Le/ttl_blog/blob/main/math/lasso-safe-screening.ipynb