Граф коммитов

299 Коммитов

Автор SHA1 Сообщение Дата
Ashutosh Srivastava becbf7f502
Effect estimation over timeseries data (#1218)
* Library functions for temporal causal functionality

* shifting plotter function

* printing graph: best practices

* added docstrings

* moved datasets

* updated tutorial notebook

* sphinx documentation

* updated shifting columns with 0,1,..,max_lag

* support for dot format

* tigramite support

* updated filter to be a hidden function

* black and isort utils

* black and isort timeseries

* updated notebook text

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* integer range fix

* correction in timestamp : notebook text

* time lagged causal estimation

* removed cell outputs

* find ancestors

* include ancestors in notebook

* formatting changes

* comments : notebook

* multiple time lags : csv graph'

* multiple time lags

* unrolled graph using bfs

* cleanup of functions

* removed find parents and ancestors

* tests for causal graph creation

* tests for adding lagged edges

* tests for shifting columns


* tigramite dependency added

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
Co-authored-by: Amit Sharma <amit_sharma@live.com>
2024-08-03 22:54:02 +05:30
Patrick Bloebaum e783e37db0 Update paper references
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2024-07-30 07:30:27 -07:00
Chris Trevino 232e123dfa
list out docsite contents pre-publish (#1234)
Signed-off-by: Chris Trevino <chtrevin@microsoft.com>
2024-07-29 16:43:58 -07:00
kmhj13 bdaf04d808
Counterfactual fairness (#1203)
Add example notebook for counterfactual fairness using GCM

Following the paper Estimates Counterfactual Fairness following Kusner et al. (2018)

---------

Signed-off-by: Kriti Mahajan <kritimhj@amazon.com>
2024-07-29 08:55:12 -07:00
yogabonito c596b1ff2f docs: small fix in user guide
Signed-off-by: yogabonito <yogabonito@users.noreply.github.com>
2024-07-01 08:27:04 -07:00
dependabot[bot] 0fa9a2e15c Bump ws from 8.11.0 to 8.17.1 in /docs/version_patcher
Bumps [ws](https://github.com/websockets/ws) from 8.11.0 to 8.17.1.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.11.0...8.17.1)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 18:22:07 -07:00
yogabonito 6f4ff22353
[DOC] fix typo (#1204)
* [DOC] fix typo

Signed-off-by: yogabonito <yogabonito@users.noreply.github.com>

* [DOC] small fix

The text first informs that PC, FCI, and GES will be considered, but instead of FCI the notebook shows LiNGAM.

Signed-off-by: yogabonito <yogabonito@users.noreply.github.com>

---------

Signed-off-by: yogabonito <yogabonito@users.noreply.github.com>
2024-06-13 13:06:19 +05:30
Jon Cowie ec9ffca5ba Fix typos, 'Falsificaton' -> 'Falsification'
Signed-off-by: Jon Cowie <jonlives@gmail.com>
2024-06-05 08:43:43 -07:00
Patrick Blöbaum 5d8fdd0992
Add a modified version of the auto MPG dataset (#1190)
Before, we were loading it directly from the UCI dataset repository. However, this cause connection issues and build fails. The dataset is now added directly with its respective license.

Further, removed the output of the causal discovery example notebook to ensure that it gets compiled while building.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2024-06-04 15:36:59 +05:30
Christoph ff068cc497
Update dowhy_causal_discovery_example.ipynb (#1186)
fix variable name for sachs data set

Signed-off-by: Christoph <krz@users.noreply.github.com>
2024-05-22 11:28:12 -07:00
Víctor Quintas-Martínez 63dea3356e
Code for Multiply-Robust Causal Change Attribution (#1183)
Add distribution_change_robust method

Adding a new distribution change method that more robust and converges faster. However, it does not support all kind of set functions. Currently, it supports mean and variance attributions.

Based on the paper:

Quintas-Martinez, V., Bahadori, M. T., Santiago, E., Mu, J., Janzing, D., and Heckerman, D. Multiply-Robust Causal Change Attribution, Proceedings of the 41st International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024.

Signed-off-by: Víctor Quintas-Martínez <vquintas@mit.edu>
2024-05-21 10:35:35 -07:00
Harsh Sinha d2962dd186
Modify graphviz installation command (#1178)
Modify graphviz installation command in README.rst, contributing-code.rst, and install.rst. Solves https://github.com/py-why/dowhy/issues/1172

Signed-off-by: Harsh Sinha <harsh.sinha@pitt.edu>
2024-05-15 08:28:11 -07:00
Rahul Shrestha a65d3d5c56 model name change
Signed-off-by: Rahul Shrestha <rahulshrestha0101@gmail.com>
2024-05-03 12:35:01 -07:00
yogabonito 74e51c37d8
[DOC] tiny improvements (#1152)
Signed-off-by: yogabonito <yogabonito@users.noreply.github.com>
2024-04-07 01:31:21 -07:00
Hongyu Lin dfbbbca369
Fix small typo in user guide (#1129)
Signed-off-by: Hongyu Lin <67950264+hon-gyu@users.noreply.github.com>
2024-02-09 01:43:21 -08:00
Jinyoung 324c40fd8f
Update intro.rst (#1133)
Update intro.rst

fix link

Signed-off-by: Jinyoung <40735154+diligejy@users.noreply.github.com>
2024-01-15 13:43:42 +05:30
Priyadutt 0c47c45eb3
Added documentation for creating causal model out of equations feature (#1124)
* added documentation for creating causal model out of equations feature

Signed-off-by: priyadutt <bhattpriyadutt@gmail.com>

* Giving only positive values to the log function

Signed-off-by: priyadutt <bhattpriyadutt@gmail.com>

---------

Signed-off-by: priyadutt <bhattpriyadutt@gmail.com>
2023-12-21 21:57:48 -08:00
Amit Sharma b3aaeb52f8
Version Bump v0.11: Updated gcm rst because of folder changes (#1097)
updated gcm rst because of folder changes

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-04 22:32:58 +05:30
Patrick Blöbaum 1fdfd30b0b
Fix small typo in user guide (#1095)
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-04 12:41:40 +05:30
Amit Sharma 299b1d7a00
Remove DeepIV econml estimator from notebook and fix flaky test (#1091)
* removed deepiv and updated flaky test

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* black reformattingb

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* removed all outputs from nb

Signed-off-by: Amit Sharma <amit_sharma@live.com>

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-03 12:35:47 +05:30
Amit Sharma 2900fd7a4e
Link list of estimators in estimate_method docstring (#1094)
* linked to up-to-date list of estimators

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* updated docs

Signed-off-by: Amit Sharma <amit_sharma@live.com>

* using absolute paths

Signed-off-by: Amit Sharma <amit_sharma@live.com>

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-03 12:35:18 +05:30
Patrick Bloebaum 9ebf9e3a0c Revised documentation
- Slightly update and revise existing GCM notebooks
- Moving mediation analysis, direct arrow strength and ICC to their own "Quantify Causal Influence" section
- Adding brief overview to describe differences between the quantification methods
- Change navigation image to reflect newest changes
- Adding related notebooks links to some of the causal task entries
- Adding a direct arrow strength example to the ICC notebook
- Adding a brief overview of the available root cause analysis and explanation methods
- Smaller revision of other GCM entries, such as the basic example
- Smaller typos and missing refernce fixes

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:50 -08:00
Patrick Bloebaum bddbb3a9ec Update
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Patrick Bloebaum 489c812f9c Overhauled readme
- Reduce it only the essential points
- Add image as overview of the offered features
- Made connection between GCM and PO framework more consistent
- Revise the GCM example to an executable code snipped
- Removed conda installation guide, because conda is still at version 0.8
- Extended some references to include GCM related work
- Fix build status icon
- Changed github references to py-why (was still pointing to microsoft)

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Patrick Bloebaum c41cefcfce Add explicit support for discrete ANMs
- Add new Discrete Additive Noise Model class that enforces the outputs to be discrete. This should help in generating more consistent data.
- As part of this, revised the auto assignment function and revised its docstring.
- Revise the auto assignment summary.
- Revise the evaluation summary.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-29 07:15:40 -08:00
Patrick Blöbaum 2a8e49a77e
Proposal: Finalize functional API refactor - deprecate causal graph (#943)
* Deprecate CausalGraph

The effect estimation API is now based on an functional API that expects a networkx graph as input.

- The graph should now be defined via a networkx graph. Most identification methods now expect an additional "observed_nodes" parameter accordingly.
- CausalModel and CausalGraph still exist and should be compatible with the old API.

---------

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
Signed-off-by: Amit Sharma <amit_sharma@live.com>
Co-authored-by: Amit Sharma <amit_sharma@live.com>
2023-11-27 09:48:55 -08:00
Patrick Bloebaum 7c015b7206 Extend GCM model evaluation by additional metrics
In addition to CRPS and depending on the node data type, it now also reports the MSE, NMSE, R2 and F1 score.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-22 07:03:53 -08:00
Patrick Bloebaum bd4f95f172 Add new example notebook demonstrating the use of the ICC methond in GCM
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-21 09:55:20 -08:00
Patrick Bloebaum 0b8f4187c0 Add GCM online shop example notebook
This is an updated and slightly modified version of the blog post: https://aws.amazon.com/blogs/opensource/root-cause-analysis-with-dowhy-an-open-source-python-library-for-causal-machine-learning/

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-20 07:08:28 -08:00
Patrick Bloebaum 1d3cd9a643 Add new GCM model evaluation module
This module adds a new method for evaluating a fitted gcm. Here, we evaluate the performance of causal mechanisms, the underlying modeling assumptions (if possible), the goodness of the generated joint distribution and the graph structure. This utilizes some of the existing methods, but also introduces new ones.

This further adds a new user guide and notebook entries demonstrating the usage.

Part of introducing the module required to make some changes in other modules and implementatins, which are mostly fixes and improvements.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-17 07:03:37 -08:00
Patrick Bloebaum cf14caab5c Remove 'experimental' disclaimer from GCM modules
Also slightly change citation hint.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-16 06:28:22 -08:00
Patrick Bloebaum 9d77022f05 Revise display of notebook examples in documentation
This change aims at providing a better overview of the notebooks by displaying them as separate cards instead of a card carousel.

Other changes:
- Introductory examples and Real world-inspired examples are now more prominent with individual images and a grid layout by 2 per-row.
- All other examples are now in a grid layout with 3 examples per row.
- Clear outputs of some notebooks.
- Fix issue with rendering counterfactual example notebook.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-15 13:13:05 -08:00
Yujia Zheng 7eb4a0c253
Update the causal discovery notebook with examples using causal-learn (#1026)
* updated a notebook with examples for causal-learn

Signed-off-by: kunwuz <514397511@qq.com>

* cleaned the output

Signed-off-by: kunwuz <514397511@qq.com>

* fixed a typo

Signed-off-by: kunwuz <514397511@qq.com>

* updated the notebook and introduced new function to load dataset

Signed-off-by: kunwuz <514397511@qq.com>

* updated some description

Signed-off-by: kunwuz <514397511@qq.com>

---------

Signed-off-by: kunwuz <514397511@qq.com>
2023-10-05 14:26:19 -07:00
Patrick Bloebaum 0df1f4c5d2 Rewrite user-guide
This significantly overhauls the user guide by changing the overall structure and adding new subsections.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
Co-authored-by: Peter Goetz <pego@amazon.com>
Co-authored-by: Amit Sharma <amit_sharma@live.com>
2023-07-27 08:47:39 -10:00
dependabot[bot] 88d79c3906 Bump word-wrap from 1.2.3 to 1.2.4 in /docs/version_patcher
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-20 06:15:15 -07:00
eeulig 4e30c63fe1 validate_graph -> run_validations, use inspect for `data` arg in validate_tpa. Restrict `falsify_graph` to those tests presented in the paper
Signed-off-by: eeulig <contact@eeulig.com>
2023-07-18 07:19:10 -07:00
eeulig 379f188d67 remove wrap_partial, simplify validate_graph, None for missing p-values
Signed-off-by: eeulig <contact@eeulig.com>
2023-07-18 07:19:10 -07:00
eeulig 4f937a55ed Remove kwargs from validation methods
Signed-off-by: eeulig <contact@eeulig.com>
2023-07-18 07:19:10 -07:00
dependabot[bot] 77b28028f6
Bump tough-cookie from 4.1.2 to 4.1.3 in /docs/version_patcher (#968)
Bumps [tough-cookie](https://github.com/salesforce/tough-cookie) from 4.1.2 to 4.1.3.
- [Release notes](https://github.com/salesforce/tough-cookie/releases)
- [Changelog](https://github.com/salesforce/tough-cookie/blob/master/CHANGELOG.md)
- [Commits](https://github.com/salesforce/tough-cookie/compare/v4.1.2...v4.1.3)

---
updated-dependencies:
- dependency-name: tough-cookie
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-16 22:26:26 +05:30
Amit Sharma dcd995b4c3
added python 3.11 to github actions and pyproject (#964)
* added py3.11 to gh actions

* updated 3.11 in pyproject for pypi

* updated torch to allow 2.0 version in pyproject

* update lock file

* updated marker for python 3.11 and torch

* second attempt:updated marker for python 3.11 and torch

* Fix types of random seeds

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>

* updated torch dependency and updated version of poetry to 1.5.1 to allow custom index-url

* Attemp to fix dockerfile poetry version

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>

---------

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
Co-authored-by: Patrick Bloebaum <bloebp@amazon.com>
2023-07-16 22:24:32 +05:30
Patrick Bloebaum 21a37a9453 Removing autolguon as optional dependency
The autogluon models can still be used with DoWhy, but it is not listed as an optional dependency anymore to reduce the number of restrictions on other packages.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-06-26 09:58:14 -07:00
Patrick Bloebaum 961ffc6373 Refactor graph.py, fcms.py and cms.py in gcm module
- fcms.py is now called causal_mechanisms.py
- cms.py is now called causal_models.py
- StochasticModel and ConditionalStochasticModel are now part of causal_mechanisms.py instead of graph.py
- graph.py is moved to the main dowhy module in preparation to replace the CausalModel class
- causal_models.py now only contains the causal models ProbabilisticCausalModel, StructuralCausalModel and InvertibleStructuralCausalModel. It also has all the validation methods related to cms.
- The PredictionModel class is now part of the gcm.ml module instead of causal_mechanisms.py

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-06-20 08:48:37 -07:00
Jivat Neet 0fb1314c5d
Adding causal prediction for general datasets (CACM) (#925)
* add causal prediction using cacm + demo notebook

Signed-off-by: jivatneet <jivatneet@gmail.com>

* Adding causal prediction code using CACM with demo notebook

Signed-off-by: jivatneet <jivatneet@gmail.com>

* addressed PR comments for causal prediction

Signed-off-by: jivatneet <jivatneet@gmail.com>

* addressing comments: fixing documentation in base_algorithm and cacm

Signed-off-by: jivatneet <jivatneet@gmail.com>

* addressing comments: fixing documentation in base_dataset

Signed-off-by: jivatneet <jivatneet@gmail.com>

* rename Algorithm class

Signed-off-by: jivatneet <jivatneet@gmail.com>

* updating base_dataset for format check

Signed-off-by: jivatneet <jivatneet@gmail.com>

* adding exception for optimizer; resolving list bug

Signed-off-by: jivatneet <jivatneet@gmail.com>

* adding docs for base algo

Signed-off-by: jivatneet <jivatneet@gmail.com>

* add algo files for general regularization

Signed-off-by: jivatneet <jivatneet@gmail.com>

* modify mnist

Signed-off-by: jivatneet <jivatneet@gmail.com>

* add changes for general cacm api

Signed-off-by: jivatneet <jivatneet@gmail.com>

* format changes general cacm api

Signed-off-by: jivatneet <jivatneet@gmail.com>

* resolve comments for general cacm api

Signed-off-by: jivatneet <jivatneet@gmail.com>

* format check

Signed-off-by: jivatneet <jivatneet@gmail.com>

* Revert "format check"

This reverts commit 6cbc3cb5c9.

Signed-off-by: jivatneet <jivatneet@gmail.com>

* format check mnist

Signed-off-by: jivatneet <jivatneet@gmail.com>

---------

Signed-off-by: jivatneet <jivatneet@gmail.com>
Signed-off-by: Jivat Neet <39404029+jivatneet@users.noreply.github.com>
2023-06-15 17:29:01 +05:30
Patrick Bloebaum cff72a84bf Revise plotting functions
There is now one common plotting function in dowhy.utils.plotting.
Before, there were two different plotting functions in the gcm module and the causal_graph object.
This change also improves the fallback networkx plot to look a bit fancier than before.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-06-05 07:50:23 -07:00
Elias Eulig f209049ee2
Add method and example to falsify a user-given DAG using a permutation-based test (#930)
Add method and example to falsify a user-given DAG using a permutation-based test

Signed-off-by: eeulig <contact@eeulig.com>
2023-05-16 08:11:47 -07:00
Patrick Bloebaum 2091c89cc3 Correct import name for autogluon
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-04-10 07:11:24 -07:00
Patrick Bloebaum 7ca6de528a Revise arrow strength user guide
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-03-07 08:14:39 -08:00
Patrick Bloebaum d7b7cc65c5 Revise gcm user guide entry for counterfactuals
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-03-07 08:14:22 -08:00
Patrick Bloebaum 5d449be765 Revise attributing distributional changes user guide entry
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-03-07 08:14:00 -08:00
Patrick Bloebaum 12168ea7bd Revise user guide entry for intrinsic causal influence
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-03-07 08:13:44 -08:00