Skip to main content

Causal Lasso

Project description

Causal Lasso

This repository implements paper "A Bregman Method for Structure Learning on Sparse Directed Acyclic Graphs" by Manon Romain and Alexandre d'Aspremont.

Install

Though pip

Run pip install causal-lasso from Terminal.

From sources

Run git clone https://github.com/manon643/causal_lasso.git. Install dependencies though pip install -r docs/requirements.txt.

Solver

For now, the default solver used at each iteration is Mosek. We plan to provide an open source implementation in the near future.

MOSEK's license is free for academic use, first obtain your license here using institutional email and place the obtained file mosek.lic in a file called:

%USERPROFILE%\mosek\mosek.lic           (Windows)
$HOME/mosek/mosek.lic                   (Linux, MacOS)

Further information available here.

Use

Minimal testing code is:

import numpy as np
import networkx as nx
from causal_lasso.solver import CLSolver
X = np.random.random((1000, 30)) # Replace with your data
lasso = CLSolver()
W_est = lasso.fit(X)
nx.draw(nx.DiGraph(W_est))

A more detailed tutorial with synthetic data is available in examples/tutorial.ipynb. If you want to apply the algorithm to your own data, you should check out examples/real_datasets.ipynb

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

causal-lasso-1.0.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

causal_lasso-1.0.1-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file causal-lasso-1.0.1.tar.gz.

File metadata

  • Download URL: causal-lasso-1.0.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.7

File hashes

Hashes for causal-lasso-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9d37d09ce83d26e02f4918508366b8adec8de8a3d915fa201484ba0d4785d58c
MD5 cf6d5ddac1940ee931521e804f4d520d
BLAKE2b-256 f4d94637113cb214400afea0437cca2cfdfa55cc3d03640c4e219fcd7e65b077

See more details on using hashes here.

File details

Details for the file causal_lasso-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: causal_lasso-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.7

File hashes

Hashes for causal_lasso-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da728458d194b0b2965a260107376dfe306f77898aa2e5058bb92417be27511d
MD5 48f6a0fa9bf2af0de9e4295388eed418
BLAKE2b-256 cffcb007cb71cbe829c9d8ae3cabf41e877443f199663019b9927b197ffeda5b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page