MuTaR: Multi-task Regression in Python
Description
MuTaR is a collection of sparse models for multi-task regression. Mutar models fit regularized regression on a sequence of related linear models (X_1, y_1) … (X_k, y_k) and follows scikit-learn’s API. Compared with scikit-learn’s MultiTaskLasso, MuTaR allows for a different design data X for each task.
Mutar models include:
- Independent linear models:
Independent Lasso estimator
Independent Re-weighted (Adaptive) Lasso estimator
- Group-norms multi-task linear models:
GroupLasso: The Group Lasso is an l1/l2 regularized regression with identical feature supports across tasks (Yuan and Lin, J. R Statistical Society 2006).
DirtyModel: Dirty models are a generalization of the Group Lasso with a partial overlap of features. They are defined using a composite l1/l2 and l1 regularization (Jalali et al., NeurIPS 2010).
MultiLevelLasso : Multilevel Lasso is a non-convex model that enhances further sparsity and encourages partial overlap with a product decomposition (Lozano and Swirszcz, ICML 2012).
- Optimal transport regularized models:
MTW: Multi-task Wasserstein is a sparse regression model where relevant features across tasks are close according to some defined geometry. (Janati et al., AISTATS 2019).
ReMTW: Reweighted MTW is a non-convex variant of MTW that promotes even more sparsity and reduces the amplitude bias caused by the L1 norm. Both models are implemented with a concomitant argument for inferring the standard deviation of each task and adapting the amount of regularization accordingly.
Installation
To install the last release of MuTaR:
pip install -U mutar
To get the current development version:
git clone https://github.com/hichamjanati/mutar cd mutar python setup.py develop
We recommend creating this minimal conda env
conda env create --file environment.yml conda activate mutar-env git clone https://github.com/hichamjanati/mutar cd mutar python setup.py develop
Example
>>> import numpy as np
>>> from mutar import GroupLasso
>>> # create some X (n_tasks, n_samples, n_features)
>>> X = np.array([[[3., 1.], [2., 0.]], [[0., 2.], [-1., 3.]]])
>>> print(X.shape)
(2, 2, 2)
>>> # and target y (n_tasks, n_samples)
>>> y = np.array([[-3., 1.], [1., -2.]])
>>> print(y.shape)
(2, 2)
>>> gl = GroupLasso(alpha=1.)
>>> coef = gl.fit(X, y).coef_
>>> print(coef.shape)
(2, 2)
>>> # coefficients (n_features, n_tasks)
>>> # share the same support
>>> print(coef)
[[-0.8 0.6]
[-0. -0. ]]
Documentation
See the doc and use examples at the MuTaR webpage.
Metadata
Release files for mutar 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mutar-0.0.1.tar.gz | 278.3 kB | Without provenance | Details for mutar-0.0.1.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mutar-0.0.1-py3.6.egg | Legacy Egg format | - | - | Details for mutar-0.0.1-py3.6.egg |
| mutar-0.0.1-cp36-cp36m-macosx_10_9_x86_64.whl | CPython 3.6 | CPython 3.6 pymalloc | macOS 10.9+ x86-64 | Details for mutar-0.0.1-cp36-cp36m-macosx_10_9_x86_64.whl |
Total release size: 397.9 kB
Release files / mutar-0.0.1.tar.gz
| Download URL | mutar-0.0.1.tar.gz |
|---|---|
| Size | 278.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
951744ff05f102f979f3290faceed9062fe8a333ade2ac9c7d7c56337ec4e4a9
|
|
BLAKE2b-256 checksum How to use checksums |
fd1f1133823b313eba87c8de24b76c318858821bd22cc3f45e0949fe48f8d19a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
|
Release files / mutar-0.0.1-py3.6.egg
| Download URL | mutar-0.0.1-py3.6.egg |
|---|---|
| Size | 19.4 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
4c23cd4e3ee289c1c976004df3de957f777848d34874ad660e3eacba84dc689a
|
|
BLAKE2b-256 checksum How to use checksums |
f34973fcd42ab4a8242411d43c9599acd1c09cd447a130e9892790a557245b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
|
Release files / mutar-0.0.1-cp36-cp36m-macosx_10_9_x86_64.whl
| Download URL | mutar-0.0.1-cp36-cp36m-macosx_10_9_x86_64.whl |
|---|---|
| Size | 100.3 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc macOS 10.9+ x86-64 |
|
SHA-256 checksum How to use checksums |
585006421339dc5f546fc51745cf919aad8ade0410bbfbca23cc49172e8205e4
|
|
BLAKE2b-256 checksum How to use checksums |
e4fee47fa097c15246cb10adfc55b69d6788e9e6f46fb4c34ac58e9b55634b26
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.18.4 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.8
|
Security for mutar 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.