Introduction to ‘cvxpy’ library:
CVXPY is an open source Python-embedded modeling language for convex optimization problems. L1 regularization induces sparsity in the model by driving some of the coefficients to exactly zero. This can be beneficial in situations where only a subset of the features is relevant to the problem, as it effectively performs feature selection.
Differences between ‘cvxpy’ and ‘scikit-learn’:
For the ‘cvxpy’ we need to explicitly define the optimization problem, including the objective function and constraints. The L1 regularization term is added to the objective function.
The Lasso class in ‘scikit-learn’ automatically handles the optimization problem for you.
It uses coordinate descent by default, which can be more efficient for large datasets.
Given the L1 optimization for underdetermined systems, why does the sparse matrix reconstruction make the reconstructed X different from the original X?
If the system of equations is underdetermined, namely there are more unknowns than equations, then there may be multiple sparse solutions that satisfy the measurement constraints. The L1 optimization might converge to one of these solutions, which could be different from the original X.
The assignment optimization problem about assigning TAs to courses can be accessed at this link.