

R specific project (available with remotes::install_github("getspams/spams-R")).Python specific project and PyPI repository (available with pip install spams).Official website (documentation and downloads).Python -c "from spams.tests import test_spams test_spams()" From the command line (assuming spams package is installed):.From Python (assuming spams package is installed):įrom spams.tests import test_spams test_spams ( '-h' ) # print the man page test_spams () # run all tests test_spams () # run specific tests test_spams ( python_exec = 'python3' ) # specify the python exec.Python tests/test_spams.py # run all the tests Python tests/test_spams.py -h # print the man page From the command line (to be called from the project root directory):.Matrices should be stored by columns, and sparse matrices should be "column compressed". Manipulated objects are imported from numpy and scipy. Make sure you have install libblas & liblapack (see above) git clone The standard installation uses the BLAS and LAPACK libraries used by Numpy: pip install spams Note for Windows users: at the moment you can run pip install spams-bin (provided by ). For better performance, we recommend to install an OpenMP-compatible compiler on your system (e.g. For MacOS users, the install setup detects if OpenMP is available on your system and enable/disable OpenMP support accordingly. It is not available for Windows at the moment. SPAMS for Python was tested on Linux and MacOS. For MacOS, you most likely need to do brew install gcc openblas lapack.įor better performance, we recommend to install the MKL Intel library (available for instance on PyPI with pip install mkl, or in the Anaconda Python distribution with conda install mkl) before installing Numpy (which is a dependency of SPAMS, the latter checking Numpy configuration for its installation). For example, on Ubuntu, it is necessary to do sudo apt-get -y install libblas-dev liblapack-dev gfortran.

a BLAS/LAPACK library (like OpenBLAS, Intel MKL, Atlas)Ĭarefully install libblas & liblapack.

a C++ modern compiler (tested with gcc >= 4.5).Solving structured sparse decomposition problems (l1/l2, l1/linf, sparse group lasso, tree-structured regularization, structured sparsity with overlapping groups.Solving sparse decomposition problems with LARS, coordinate descent, OMP, SOMP, proximal methods.

