Skip to main content

No project description provided

Project description

Causal discovery

Causal discovery is the process of inferring causal relationships between variables from observational data. This repository aims to provide a collection of causal discovery algorithms implemented in Python.

Development setup

This repository uses Poetry as a dependency manager. To install the dependencies, run:

$ poetry install

Usage

Pull this repository and run the following command:

$ poetry build

Then, install the package:

$ pip install dist/causal-discovery-0.1.0.tar.gz

example usage:

from causal_discovery.algos.notears import NoTears

# load dataset
dataset = ...  

# initialize model
model = NoTears(
    rho=1, 
    alpha=0.1, 
    l1_reg=0, 
    lr=1e-2
)

# learn the graph
_ = model.learn(dataset.X)

# adjacency matrix
print(model.W)

Algorithms

Algorithm Reference
NOTEARS DAGs with NO TEARS: Continuous Optimization for Structure Learning, 2019

Results

This is the example of the results of the algorithm.

Results

How to read this figure: for any value in coordinate (x, y) means the causal effect from y -> x.

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_discovery-0.1.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

causal_discovery-0.1.0-py3-none-any.whl (7.1 kB view hashes)

Uploaded Python 3

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