Metadata-Version: 2.4
Name: dodiscover
Version: 0.0.0.dev0
Summary: Causal discovery in Python
Maintainer-email: PyWhy <adam.li@columbia.edu>
License: MIT License
        
        Copyright (c) 2022 PyWhy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Keywords: causality,causal discovery,causal-inference,structure learning
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<2.0,>=1.25.0
Requires-Dist: scipy>=1.9.0
Requires-Dist: scikit-learn>=1.5.0
Requires-Dist: pandas>=1.5.0
Requires-Dist: networkx>=3.2.0
Requires-Dist: pygam>=0.9.0
Provides-Extra: all
Requires-Dist: dodiscover[build]; extra == "all"
Requires-Dist: dodiscover[doc]; extra == "all"
Requires-Dist: dodiscover[style]; extra == "all"
Requires-Dist: dodiscover[test]; extra == "all"
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Requires-Dist: numpy<2.0,>=1.25.0; extra == "build"
Provides-Extra: doc
Requires-Dist: memory-profiler; extra == "doc"
Requires-Dist: numpydoc; extra == "doc"
Requires-Dist: pooch; extra == "doc"
Requires-Dist: pydata-sphinx-theme; extra == "doc"
Requires-Dist: sphinx==7.2.6; extra == "doc"
Requires-Dist: sphinx-copybutton; extra == "doc"
Requires-Dist: sphinx-design; extra == "doc"
Requires-Dist: sphinx-gallery; extra == "doc"
Requires-Dist: sphinx-issues; extra == "doc"
Requires-Dist: sphinx_autodoc_typehints; extra == "doc"
Requires-Dist: sphinxcontrib-bibtex; extra == "doc"
Requires-Dist: portray; extra == "doc"
Requires-Dist: matplotlib; extra == "doc"
Requires-Dist: ipython; extra == "doc"
Requires-Dist: nbsphinx; extra == "doc"
Requires-Dist: pandas; extra == "doc"
Requires-Dist: seaborn; extra == "doc"
Requires-Dist: joblib; extra == "doc"
Requires-Dist: graphviz; extra == "doc"
Requires-Dist: pygraphviz; extra == "doc"
Requires-Dist: pgmpy; extra == "doc"
Provides-Extra: style
Requires-Dist: pre-commit; extra == "style"
Requires-Dist: black; extra == "style"
Requires-Dist: codespell; extra == "style"
Requires-Dist: isort; extra == "style"
Requires-Dist: pydocstyle; extra == "style"
Requires-Dist: pydocstyle[toml]; extra == "style"
Requires-Dist: rstcheck; extra == "style"
Requires-Dist: ruff; extra == "style"
Requires-Dist: toml-sort; extra == "style"
Requires-Dist: yamllint; extra == "style"
Requires-Dist: mypy; extra == "style"
Requires-Dist: toml; extra == "style"
Provides-Extra: test
Requires-Dist: joblib; extra == "test"
Requires-Dist: pandas; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: flaky; extra == "test"
Requires-Dist: tqdm; extra == "test"
Requires-Dist: pooch; extra == "test"
Requires-Dist: causal-learn; extra == "test"
Requires-Dist: statsmodels; extra == "test"
Requires-Dist: pywhy-graphs; extra == "test"
Requires-Dist: dowhy; extra == "test"
Requires-Dist: bnlearn; extra == "test"
Requires-Dist: ananke-causal<0.4.0; extra == "test"
Dynamic: license-file

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![CircleCI](https://circleci.com/gh/py-why/dodiscover/tree/main.svg?style=svg)](https://circleci.com/gh/py-why/dodiscover/tree/main)
[![unit-tests](https://github.com/py-why/dodiscover/actions/workflows/main.yml/badge.svg)](https://github.com/py-why/dodiscover/actions/workflows/main.yml)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![codecov](https://codecov.io/gh/py-why/dodiscover/branch/main/graph/badge.svg?token=H1reh7Qwf4)](https://codecov.io/gh/py-why/dodiscover)

# DoDiscover

DoDiscover is a Python library for causal discovery (causal structure learning). If one does not have access to a causal graph for their modeling problem, they may use DoDiscover to learn causal structure from their data (e.g., in the form of a graph).

# What makes dodiscover different from other causal discovery libraries?

Why do we need another causal discovery library?
Here are some design goals that differentiate DoDiscover from other causal discovery libraries.

## Ease of use

An analyst should be able to get a causal discovery workflow working quickly without intimate knowledge of causal discovery algorithms.
DoDiscover prioritizes the workflow over the algorithms and provides default arguments to algorithm parameters.

## Democratizing deep causal discovery

Many cutting-edge causal discovery algorithms rely on deep learning frameworks.
However, deep learning-based causal discovery often requires obscure boilerplate code, complex configuration, and management of large artifacts such as embeddings.
DoDiscover seeks to create abstractions that address these challenges and make deep causal discovery more broadly accessible. Current algorithms are a work-in-progress. We will begin by providing a robust API for the fundamental discovery algorithms.

## Easy interface for articulating causal assumptions

Domain experts bring a large amount of domain knowledge to a problem.
That domain knowledge can establish causal assumptions that can constrain causal discovery.
Causal discovery (indeed, all causal inferences) requires causal assumptions.

However, a newly developed causal discovery algorithm has a greater research impact when it can do more with fewer assumptions.
This "do more with less" orientation tends to deemphasize assumptions in the user interfaces of many causal discovery libraries.

DoDiscover prioritizes the interface for causal assumptions.
Further, DoDiscover seeks to help the user feel confident with their assumptions by emphasizing testing assumptions, making inferences under uncertainty, and robustness to model misspecification.

## Unite causal discovery and causal representation learning

DoDiscover is a Python library for causal discovery (causal structure learning).
Our goal is to provide developers and researchers with guide rails for causal discovery that doesn't require deep knowledge of individual causal discovery algorithms.

## What is the difference between dodiscover and other pywhy packages?

The goal of dodiscover is to flatten the on-ramp to causal discovery algorithms.
DoWhy provides a consistent API for various causal tasks that typically require a graph structure.
Similarly, DoDiscover aims to provide a cohesive and user-friendly API to apply causal discovery algorithms for inferring a causal graph from data.

[causal-learn](https://github.com/py-why/causal-learn) is an extensive collection of causal discovery algorithms.
It continuous to host new cutting-edge algorithms in causal discovery.
However, these algorithms do not have a unified API.
Further, the historic focus of causal-learn is increasing the capabilities of discovery algorithms.
In contrast, dodiscover's focus is on the discovery API and usability.

When possible, dodiscover prefers to provide an API wrapper to discovery algorithms in causal-learn and other libraries.
Please consider contributing to [causal-learn](https://github.com/py-why/causal-learn) if you plan to implement an algorithm from scratch, then contributing a wrapper in dodiscover.

In the future we plan on trying to integrate the two libraries.

## What is the relationship with pywhy-graphs and pywhy-stats?

[pywhy-graphs](https://github.com/py-why/pywhy-graphs) is the home of graph data structures and graph algorithms in PyWhy.

[pywhy-stats](https://github.com/py-why/pywhy-stats) serves as a repository for implementations of (un)conditional independence tests, which can be utilized in various tasks, such as causal discovery.

# Documentation

See the [development version documentation](https://py-why.github.io/dodiscover/dev/index.html).

Or see [stable version documentation](https://py-why.github.io/dodiscover/stable/index.html)

# Installation

Installation is best done via `pip` or `conda`. For developers, they can also install from source using `pip`. See [installation page](TBD) for full details.

## Dependencies

Minimally, dodiscover requires:

    * Python (>=3.10)
    * numpy
    * scipy
    * networkx
    * pandas

We have removed support for Python 3.8 as we depend explicitly on networkx, which has deprecated Python 3.8 support. For explicit graph functionality for representing various causal graphs, such as ADMG, or CPDAGs, you will also need:

    * pywhy-graphs

For explicitly representing causal graphs, we recommend using `pywhy-graphs` package, but if you have a graph library that adheres to the graph protocols we require, then you can in principle use those graphs.

## User Installation

If you already have a working installation of numpy, scipy and networkx, the easiest way to install dodiscover is using `pip`:

    # doesn't work until we make an official release :p
    pip install -U dodiscover

To install the package from github, clone the repository and then `cd` into the directory. You can then use `pip` to install:

    pip install -e .

    # for extra functionality for documentation, building, style checking and unit-testing
    pip install .[doc, build, style, test]
