py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.1k stars 935 forks source link

module 'dowhy.gcm' has no attribute 'fit_and_compute' #904

Closed Mrzhangxiaohua closed 1 year ago

Mrzhangxiaohua commented 1 year ago

in gcm_rca_microservice_architecture.ipynb

code:

median_attribs, uncertainty_attribs = gcm.confidence_intervals(
    gcm.fit_and_compute(gcm.attribute_anomalies,
                    causal_model,
                    normal_data,
                    target_node='Website',
                    anomaly_samples=outlier_data),
    num_bootstrap_resamples=10)

it doesn't work and report module 'dowhy.gcm' has no attribute 'fit_and_compute'

petergtz commented 1 year ago

@Mrzhangxiaohua Which version of DoWhy are you using? Also, could you please provide a stacktrace.

Mrzhangxiaohua commented 1 year ago

@Mrzhangxiaohua Which version of DoWhy are you using? Also, could you please provide a stacktrace. the dowhy version is 0.8

the stacktrace is below:

AttributeError Traceback (most recent call last) Cell In[39], line 4 1 gcm.config.disable_progress_bars() # to disable print statements when computing Shapley values 3 median_attribs, uncertainty_attribs = gcm.confidence_intervals( ----> 4 gcm.fit_and_compute(gcm.attribute_anomalies, 5 causal_model, 6 normal_data, 7 target_node='Website', 8 anomaly_samples=outlier_data), 9 num_bootstrap_resamples=10)

AttributeError: module 'dowhy.gcm' has no attribute 'fit_and_compute'

petergtz commented 1 year ago

@Mrzhangxiaohua Please update to version 0.9.1. This function was renamed and has a different name in version 0.8.

Mrzhangxiaohua commented 1 year ago

yeah,when i update the correct version,the problem has been solved 👍