Skip to main content

Sample from general structural causal models (SCMs).

Project description

Sempler: Sampling observational and interventional data from general structural equation models (SEMs)

You can find the full docs at https://sempler.readthedocs.io/en/latest/.

Installation

You can clone this repo or install using pip:

pip install sempler

Sempler is still at its infancy and its API is subject to change. Non backward-compatible changes to the API are reflected by a change to the minor or major version number,

e.g. code written using sempler==0.1.2 will run with sempler==0.1.3, but may not run with sempler==0.2.0.

Overview

Sempler allows you to generate observational and interventional data from general structural causal models.

Two classes are defined for this purpose.

  • sempler.ANM is for general (acyclic) additive noise SCMs. Any assignment function is possible, as are the distributions of the noise terms.
  • sempler.LGANM is for linear Gaussian SCMs. While this is also possible with sempler.ANM, this class simplifies the interface and offers the additional functionality of sampling "in the population setting", i.e. by returning a symbolic gaussian distribution (see sempler.LGANM.sample and sempler.NormalDistribution).

To allow for random generation of SCMs and interventional distributions, the module sempler.generators contains functions to sample random DAGs and intervention targets.

Documentation

You can find the docs at https://sempler.readthedocs.io/en/latest/.

Feedback

Feedback is most welcome! You can add an issue or send an email.

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

sempler-0.2.3.tar.gz (26.7 kB view hashes)

Uploaded Source

Built Distribution

sempler-0.2.3-py3-none-any.whl (38.6 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