Closed Lllllp93 closed 1 year ago
We have fixed this issue in the main branch which is not released yet. Upgrade ylearn from latest source code and try again please.
Hi, I just found an error after I upgrade Ylearn from latest source code, here is the error msg:
ModuleNotFoundError Traceback (most recent call last) Cell In [2], line 4 1 import numpy as np 2 import matplotlib.pyplot as plt ----> 4 from ylearn.estimator_model.causal_tree import CausalTree, CTCausalForest 5 from ylearn.exp_dataset.exp_data import sq_data 6 from ylearn.utils._common import to_df
File c:\Users\peng.liu2\Anaconda3\envs\CV\lib\site-packages\ylearn__init__.py:2 1 from ._version import version ----> 2 from ._why import Why
File c:\Users\peng.liu2\Anaconda3\envs\CV\lib\site-packages\ylearn_why.py:11 9 from ylearn import metric as M 10 from ylearn import sklearn_ex as skex ---> 11 from ylearn.causal_discovery import CausalDiscovery 12 from ylearn.causal_model import CausalModel, CausalGraph 13 from ylearn.effect_interpreter.policy_interpreter import PolicyInterpreter
ModuleNotFoundError: No module named 'ylearn.causal_discovery'
And I am not sure if there is a problem with my installation method. I just run python setup.py install
with latest source code.
reopen for latest source code
YLearn can be installed from source code with command:
cd <ylearn_source_dir>
pip install .
Note 1: c&c++ complier is required to build cython extension, so install microsoft visual C++ 2015 or higher on windows. see https://wiki.python.org/moin/WindowsCompilers for more details.
Note 2: ylearn does not install torch by default on windows, so install it seperately with command pip install torch
.
I try to use CausalTree as the estimator in
why()
, but seems likeCausalTree.estimate()
got unexpected keyword arguments.Here is my code:
and error msg:
I found that CausalTree.estimate() only accept data and quantity as arguments, so how can I use CausalTree as the estimator in
why()