* 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>
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>
* [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>
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>
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>
* 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>
* 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>
* 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>
- 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>
- 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>
- 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>
* 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>
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>
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>
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>
* 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>
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>
* 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>
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>
- 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>
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>