L0Learn is a highly efficient framework for solving L0-regularized learning problems.
Project description
l0learn: Fast Best Subset Selection
Hussein Hazimeh, Rahul Mazumder, and Tim Nonet
Massachusetts Institute of Technology
Introduction
L0Learn is a highly efficient framework for solving L0-regularized learning problems. It can (approximately) solve the following three problems, where the empirical loss is penalized by combinations of the L0, L1, and L2 norms:
We support both regression (using squared error loss) and classification (using logistic or squared hinge loss). Optimization is done using coordinate descent and local combinatorial search over a grid of regularization parameter(s) values. Several computational tricks and heuristics are used to speed up the algorithms and improve the solution quality. These heuristics include warm starts, active set convergence, correlation screening, greedy cycling order, and efficient methods for updating the residuals through exploiting sparsity and problem dimensions. Moreover, we employed a new computationally efficient method for dynamically selecting the regularization parameter λ in the path. We describe the details of the algorithms in our paper: Fast Best Subset Selection: Coordinate Descent and Local Combinatorial Optimization Algorithms (link).
The toolkit is implemented in C++11 and can often run faster than popular sparse learning toolkits (see our experiments in the paper above). We also provide an easy-to-use R interface; see the section below for installation and usage of the R package.
NEW: Version 2 (03/2021) adds support for sparse matrices and box constraints on the coefficients.
Package Installation
l0learn
comes pre-packaged with a version of Amardillo
l0learn
Currently is only supported on Linux and MacOS. Windows support is an active area of development.
The latest version (v2.0.3) can be installed from pip as follows:
pip install l0learn
Documentation
Documentation can be found here
Source Code and Installing from Source
Alternatively, l0learn
can be build from source
git clone https://github.com/TNonet/L0Learn.git
cd python
To install, ensure the proper packages are installed from pyproject.toml
build from source with the following:
pip install ".[test]"
To test, run the following command:
python -m pytest
Change Log
L0Learn's changelog can be accessed from here.
Usage
For a tutorial, please refer to l0learn's Vignette(Link to be added). For a detailed description of the API, check the Documentation(link to be added).
FAQ
Which penalty to use?
Pure L0 regularization can overfit when the signal strength in the data is relatively low. Adding L2 regularization can alleviate this problem and lead to competitive models (see the experiments in our paper). Thus, in practice, we strongly recommend using the L0L2 penalty. Ideally, the parameter gamma (for L2 regularization) should be tuned over a sufficiently large interval, and this can be performed using L0Learn's built-in cross-validation method.
Which algorithm to use?
By default, L0Learn uses a coordinate descent-based algorithm, which achieves competitive run times compared to popular sparse learning toolkits. This can work well for many applications. We also offer a local search algorithm which is guarantteed to return higher quality solutions, at the expense of an increase in the run time. We recommend using the local search algorithm if your problem has highly correlated features or the number of samples is much smaller than the number of features---see the local search section of the Vignette for how to use this algorithm.
How to certify optimality?
While for many challenging statistical instances L0Learn leads to optimal solutions, it cannot provide certificates of optimality. Such certificates can be provided via Integer Programming. Our toolkit L0BnB is a scalable integer programming framework for L0-regularized regression, which can provide such certificates and potentially improve upon the solutions of L0Learn (if they are sub-optimal). We recommend using L0Learn first to obtain a candidtate solution (or a pool of solutions) and then checking optimality using L0BnB.
Citing L0Learn
If you find L0Learn useful in your research, please consider citing the following two papers.
Paper 1:
@article{doi:10.1287/opre.2019.1919,
author = {Hazimeh, Hussein and Mazumder, Rahul},
title = {Fast Best Subset Selection: Coordinate Descent and Local Combinatorial Optimization Algorithms},
journal = {Operations Research},
volume = {68},
number = {5},
pages = {1517-1537},
year = {2020},
doi = {10.1287/opre.2019.1919},
URL = {https://doi.org/10.1287/opre.2019.1919},
eprint = {https://doi.org/10.1287/opre.2019.1919}
}
Paper 2:
@article{JMLR:v22:19-1049,
author = {Antoine Dedieu and Hussein Hazimeh and Rahul Mazumder},
title = {Learning Sparse Classifiers: Continuous and Mixed Integer Optimization Perspectives},
journal = {Journal of Machine Learning Research},
year = {2021},
volume = {22},
number = {135},
pages = {1-47},
url = {http://jmlr.org/papers/v22/19-1049.html}
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file l0learn-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.0 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41f0de13e2f0cc461bc6e57fad9bb795829836a065d1cbf521bf959cd0dd3f96 |
|
MD5 | 672e1ea2f233cfc8c77221e69a841df5 |
|
BLAKE2b-256 | a6c710fcfcfe7e078c6aa62699fd2316665734912e2b88dd0ff4d7ba680db048 |
File details
Details for the file l0learn-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8061cceb9cb20e4797bf59ee72c0017a216e0ffd046f2caf83af1491c8e7f2e |
|
MD5 | c74425e421da9570b4918778d644779a |
|
BLAKE2b-256 | f69144563bbfaf67ae6eb1fe1f0f79f97666c6a51fef957f9b801ed6a34c8ac4 |
File details
Details for the file l0learn-0.4.3-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4cb7c6c2567629e13bd77dc3683c02c4254cbca4aff2a61fe4e84e70624cc8a |
|
MD5 | 1ff61549ad4c898c210f2dd5c8c5bcbc |
|
BLAKE2b-256 | aa60215153c0a89084775ea10d95d7e95523d49f9b5c90b700fe9e00889c5f23 |
File details
Details for the file l0learn-0.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.0 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f9b756687c570dbba76a53cf11420d84e0f96432ec5d0dac1e5389416ec1b62 |
|
MD5 | 64bc5cdafb62bc9b275294490bf25329 |
|
BLAKE2b-256 | e8349ae92bd0f71333768e47ece0614f436d677533d3631ce982bf318ef0b92b |
File details
Details for the file l0learn-0.4.3-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0f1711fe8fca0b6db3f8c591da9915b48db19c55b28fc528079962b83a3ae89 |
|
MD5 | c15d2f96ad5813ba09430a0ee1b86ed5 |
|
BLAKE2b-256 | 9f39b536413bec717e8bb89d41eedc932d8fbc8e1272e799fd631893330a3764 |
File details
Details for the file l0learn-0.4.3-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b8a0b26dc410364526b9088618b811fefb0c655bd3306916cdb858a5f3f2e75 |
|
MD5 | 933331156b5c64274758000b00037d5a |
|
BLAKE2b-256 | 247f7000aec6d18800fed87d3208b75eab296bb4d152a1a76eb93f3f24732a68 |
File details
Details for the file l0learn-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.0 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15fc058721dcf29eb3fa3712e80e1ec09d48b3b38fa4ee40c7e1433d48153d5f |
|
MD5 | 82d27f6d2aec1e7783eb07a64ad97fdc |
|
BLAKE2b-256 | 4c6fbfce0ff1a03f0b98e3a200e3c6ace9f5092a5890d0cc3e87a8786da80411 |
File details
Details for the file l0learn-0.4.3-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3702d864ae9ef2ef18a2b4b36101e46578936745f691a4edab07a73a7a6cdcf |
|
MD5 | f022154b14c5d16850a4beddac1ba1e8 |
|
BLAKE2b-256 | 3cff2bc54eae4ef9261ea7ca4fc2b43624ee3ac30679896cdaae12088574767f |
File details
Details for the file l0learn-0.4.3-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5868952291cb9fa9453d6c3ba476508d5f5f1a2670db63e93f37da0fd1e734a4 |
|
MD5 | 7b08c03c1993ce9e587672a9ed401467 |
|
BLAKE2b-256 | 44f7d9cf0875161de68c683ec98d4679f7ca89ac36a158b29538e0d0391c28d2 |
File details
Details for the file l0learn-0.4.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 15.0 MB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab035163fd1b70a638dd62e1340b13bf568609c1746d00c5a32e52075f11d7b8 |
|
MD5 | f367bf28984f656e1207410855ae0889 |
|
BLAKE2b-256 | edeed2e465ececad1ef4ddc82116fe85bce55fc3fd5b917b734227f5db9f7009 |
File details
Details for the file l0learn-0.4.3-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: l0learn-0.4.3-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 1.4 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 21ffdf4003b476dc3deae1defad22bddd9dff71303a141e88f7a5b999991f5bd |
|
MD5 | 7c97443db16ceba1887159751d93ba1b |
|
BLAKE2b-256 | 75f1dc0207cd1cb838b2dc6389cf1bbfee8cfaf6c5972e9324df703b55a9d267 |