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

1017 Коммитов

Автор SHA1 Сообщение Дата
dependabot[bot] 4bb4a43fb8 Bump actions/stale from 8 to 9
Bumps [actions/stale](https://github.com/actions/stale) from 8 to 9.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 07:06:24 -08:00
dependabot[bot] 9c872a6ad2 Bump pmorelli92/github-container-registry-build-push from 2.1.0 to 2.2.1
Bumps [pmorelli92/github-container-registry-build-push](https://github.com/pmorelli92/github-container-registry-build-push) from 2.1.0 to 2.2.1.
- [Release notes](https://github.com/pmorelli92/github-container-registry-build-push/releases)
- [Commits](https://github.com/pmorelli92/github-container-registry-build-push/compare/2.1.0...2.2.1)

---
updated-dependencies:
- dependency-name: pmorelli92/github-container-registry-build-push
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 06:59:38 -08:00
Priyadutt df053f4eda
fixed a bug where wrong node is identified as unknown model (#1108)
Fixed a bug where wrong node is identified as unknown model

---------

Signed-off-by: priyadutt <bhattpriyadutt@gmail.com>
2023-12-08 11:13:35 -08:00
priyadutt 6038f4d886 equation to graph implementation with test cases added.
Signed-off-by: priyadutt <bhattpriyadutt@gmail.com>
2023-12-06 13:23:12 -08:00
Amit Sharma e66ed36f1b
Fix errors in README and add a test to avoid such errors in the future (#1103)
* fixing pypi readme errors and adding a test

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

* installing dynamic versioning

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

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-06 13:39:39 +05:30
Amit Sharma e7bd2ad84f
Fixing python publish workflow to run after version tag is created (#1100)
fixed workflow to include tags and fixed pyproject to output the latest tag version

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-05 23:00:52 +05:30
Patrick Blöbaum 75723e3b6c
Fix formatting issue in readme (#1099)
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-05 22:30:16 +05:30
Amit Sharma 56d3fc27f1 updated python publish workflow to support pypi 2fa
Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-04 10:16:36 -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 92030c8874
Add compatibility between GCM and CausalModel class (#1084)
* Add compatibility between GCM and CausalModel class

Before, the causal graphs between the GCM and CausalModel part required some additional work to be converted.
Now, a GCM can be used to initiate a CausalModel or CausalGraph and vice versa.

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

* minor changes and updating docstrings

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

* fixed error when incompatible type is added and added a test for it

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

* fixed formatting issues

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

---------

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-12-04 21:26:18 +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
Patrick Bloebaum 1df8561f32 Fix issue in falsify method when no tests were performed
It now does not raise a division by zero error anymore. Other changes:
- Add new parameter indicating whether the method requires data for all nodes in the graph or also allows a subset of data.
- If no tests were performed, the summary now returns "Cannot be evaluated".

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-03 08:19:19 -08:00
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
Amit Sharma 048117c483
Bug fix for frontdoor identification and a new set of tests (#1093)
* fixed frontdoor bug and added tests

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

* updated docstring

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

* reformatted file

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

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-03 12:34:38 +05:30
Amit Sharma 1d050f0fc8
Bug fix: Linear regression CATE estimates were not shown even when need_conditional_estimates is True (#1092)
* fixed bug where CATE is not returned by lr

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

* added test

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

* formatted file

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

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-12-03 12:34:17 +05:30
Patrick Bloebaum 918efc6bdd Change readme notebook links to compiled HTML versions
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 08:08:40 -08:00
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 f455c569db Make example sections more prominent
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Patrick Bloebaum 591e9d916e Add pywhy refrence
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Patrick Bloebaum 3475b195cc Fix documentation box
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Patrick Bloebaum 031d49e006 Update
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Patrick Bloebaum bddbb3a9ec Update
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-12-01 06:58:26 -08:00
Amit Sharma a2a79b371c added decision-making intro and econml code snippet
Signed-off-by: Amit Sharma <amit_sharma@live.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
Amit Sharma 4fd0a92bd2
auto identify the effect modifier columns for `effect' method for EconML estimators (#1061)
* auto identify the effect modifier columns

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

* fixed formatting errors

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

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-11-27 14:40:31 +05:30
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 bd23532342 Change default parameter of SVC model in the GCM module
Before, the Support Vector Classifier did not produce probabilities, which are required for different algorithms in the GCM module. This changes the 'probability' parameter to True.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-21 09:01:36 -08:00
Patrick Bloebaum c88cc83d83 Fix issue in bar_plot with misspecified confidence intervals
If the confidence intervals are misspecified, e.g., greater lower bound than upper bound, the method threw an error before. This, however, can sometimes happen due to precision errors in some algorithms and lead to random build fails. This change fixes the issue and ignores invalid intervals accordingly.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-21 07:54:34 -08:00
Patrick Bloebaum cae656a3f2 Fix issue with MedianCDFQuantileScorer
Before, the scorer was not able to handle numpy object types directly. However, GCM often uses the object dtype to ensure support of mixing categorical and float values. This fixes the handling of object dtypes by explicitly converting them to floats first.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-21 07:07:37 -08:00
dependabot[bot] 5a6ce23d86 Bump actions/github-script from 6 to 7
Bumps [actions/github-script](https://github.com/actions/github-script) from 6 to 7.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-20 07:43:57 -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 ced5d726a3 Fix handling of NaN values in MedianCDFQuantileScorer
NaN values are now correctly counted when estimating the anomaly score.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-20 07:07:58 -08:00
Patrick Bloebaum b2e75a7a70 Fix issue in KL estimation using knn
Before, the method threw an error when all samples were equal. However, in these cases, it should rather return a KL divergence of 0.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-17 09:42:56 -08:00
Patrick Bloebaum 601c2ae5a2 Remove deprecated feature.py module from GCM
These methods are now available in the feature_relevance.py module.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-17 07:03:55 -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 e846851b3f Address issue with timeouts in unit change tests
The build sometimes randomly fails due to a timeout issue in the unit tests of the unit change methods of the GCM module. While this only happens in the github builds, this is most likely due to the prallelization of the underlying RandomForestRegressors being fitted.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-16 06:28:38 -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
Patrick Bloebaum 57656afe9c Fix issue with linear regressor with fixed parameters
Before, when creating a linear regressor with fixed parameters, these parameters are overridden when fit to data. Now, the parameters remain fixed.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-15 07:25:53 -08:00
Patrick Bloebaum b9ae10b00f Fix issue with auto assignment with imbalanced classes
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-15 07:18:57 -08:00
Patrick Bloebaum eb88735806 Add new method to estimate KL divergence using classifier
This should work better with multivariate data and mixed data types. However, it is generally slower than the knn appraoch.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-15 07:00:17 -08:00
Amit Sharma 395d1fa467
Fix frontdoor estimation bug (#1060)
* fixed frontdoor bug

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

* fixed formatting issues

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

---------

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-11-10 10:08:24 +05:30
Amit Sharma d8e662b3b1
Relaxed depedency version requirements for sympy and cython (#1062)
relaxed depedency version requirements

Signed-off-by: Amit Sharma <amit_sharma@live.com>
2023-11-06 22:58:01 +05:30
Patrick Bloebaum ef91e18379 Change use of Protocol from typing instead of typing_extension
The graph module uses Protocols, which is natively supported since Python 3.8 (the required minimum version for DoWhy). To support Protocols in earlier Python versions, an extension provided Protocol support. However, this extension can causes compatibility issues with newer versions of other packages.

DoWhy now uses the Protocol implementation that is available since Python 3.8.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-03 14:44:29 -07:00
Patrick Bloebaum 8c893fe0e0 Fix timeout issues in tests for the unit_change module
Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-03 14:44:09 -07:00
Patrick Bloebaum 8c27fcd732 Change default value of layout in view_model of CausalModel
Changing the value from "dot" to None. The current default value requires the dot extension to be installed. However, if it is not installed, an error is raised. By default, this should not happen since it is an optional dependency.

Signed-off-by: Patrick Bloebaum <bloebp@amazon.com>
2023-11-02 13:04:23 -07:00