image0 image1

sparse-ho stands for “sparse hyperparameter optimization”. This package implements efficient hyperparameter tuning for sparse machine learning models. It supports models such as the Lasso, the Weighted Lasso, multiclass sparse Logistic regression, SVM, etc.

Relying on a first order algorithm for bilevel optimization, sparse-ho’s performances scales gracefully with the number of hyperparameters to tune.

In order to benchmark performances, the package also implements alternatives such as forward or backward differentiation.


Please visit ``_ for the latest version of the documentation.


To run the code you first need to clone the repository, and then run, in the folder containing the file (root folder):

pip install -e .


If you use this code, please cite:

    title={Implicit differentiation of Lasso-type models for hyperparameter optimization},
    author={Bertrand, Q. and Klopfenstein, Q. and Blondel, M. and Vaiter, S. and Gramfort, A. and Salmon, J.},

Code to reproduce the figures of the paper is in the expes folder.

ArXiv link: