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.
Requirements
This package requires numpy
, scipy
, tqdm
, networkx
and mosek
, installation can be done with 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 is available in examples/tutorial.ipynb
.
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 Distribution
Built Distribution
Hashes for causal_lasso-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a6fc7b9ec562e92a32e4fa46dc75172f63d34d605c6c891396e814e88b6ec74 |
|
MD5 | 1dd70ff3d74af2bafb0822b4452a008d |
|
BLAKE2b-256 | 9ec71b04c5f706a5b895e94b64be06b1b5f56f72dc1949a6a4bd6d779e68e18d |