Skip to content

benchopt/benchmark_slope

Repository files navigation

Benchmark Repository for SLOPE

Build Status Python 3.9+

This repository is dedicated to regression with the Sorted L-One Penalized Estimation (SLOPE) estimator which consists in solving the following program:

$$ \min_{\beta} \, \tfrac{1}{2n} \Vert y - X\beta \Vert^2_2 + J(\beta, \lambda) $$

where

$$ J(\beta, \lambda) = \sum_{j=1}^p \lambda_j | \beta_{(j)}| $$

with $\lambda_1 \geq \lambda_2 \geq ... \geq \lambda_p$ and $|\beta_{(1)}| \geq |\beta_{(2)}| \geq ... \geq |\beta_{(p)}|$.

We note $n$ (or n_samples) the number of samples and $p$ (or n_features) the number of features. We also have that $X\in \mathbb{R}^{n\times p}$ and $y\in \mathbb{R}^n$.

Installing Benchopt

This benchmark relies on benchopt, a generic framework for running numerical benchmarks. The recommended way to use benchopt is within a conda environment. So, begin by creating and activating a new conda environment and install benchopt in it:

$ conda create -n benchopt python
$ conda activate benchopt
$ pip install -U benchopt

Installing the Benchmark

To install the benchmark, clone this repository and move to its folder:

$ git clone https://github.com/benchopt/benchmark_slope
$ cd benchmark_slope/

To install the dependencies for the solvers and datasets for the benchmark, first make sure that you have activated the conda environment where benchopt is installed. Then, you can either install all the dependencies with:

$ benchopt install .

Or you can install only a subset of solvers by specifying them with the -s option.

Running the Benchmark

To run the benchmark, simply use the benchopt run command:

$ benchopt run .

By default, all solvers and datasets are run. You can restrict the benchmark to some solvers or datasets, e.g.:

$ benchopt run -s PGD[prox=prox_fast_stack] -d libsvm[dataset=real-sim,standardize=True]

You can also specify a YAML configuration file to set the parameters of the benchmark. An example config is provided in <example_config.yml>.

$ benchopt run --config example_config.yml .

Use benchopt run -h for more details about these options, or visit https://benchopt.github.io/api.html.

Acknowledgments

This repository is based on the work of Johan Larsson, Quentin Klopfenstein, Mathurin Massias and Jonas Wallin at https://github.com/Klopfe/benchmark_slope.

About

Benchopt-based benchmark for Sorted L-One Penalized Estimation

Resources

Stars

Watchers

Forks

Contributors