You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project comparing various causal discovery algorithms in the Causal Discovery Toolbox (CDT).
I am encountering an error with the CCDr algorithm.
All three data types (hybrid, continuous, and discrete) didn't work. I also changed the temporary directory, which let me visibly see the temporary folder/files being created while it was processing and then immediately deleted. So, I don't think it's an access/permission issue.
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
from cdt.causality.graph import CCDr
# from cdt.metrics import precision_recall, SID, SHD
# Load data
file = 'data1.csv'
data = pd.read_csv(file)
# Create and visualize CDT graph
model = CCDr()
prediction = model.predict(data)
pos = nx.spring_layout(prediction)
nx.draw_networkx(prediction, pos, with_labels=True, node_size=300)
plt.show()
Error:
R Python Error Output
[Errno 2] No such file or directory: '/Users/oriana/CDT/CDT_Algorithms/check/cdt_ccdr_f8b6bdf0-3c90-4f35-b860-8abe44173994/result.csv'
Traceback (most recent call last):
File "/Users/oriana/CDT/CDT_Algorithms/check/CCDr.py", line 27, in
prediction = model.predict(data)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/model.py", line 63, in predict
return self.create_graph_from_data(df_data, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/CCDr.py", line 121, in create_graph_from_data
results = self._run_ccdr(data, verbose=self.verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/CCDr.py", line 142, in _run_ccdr
raise e
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/CCDr.py", line 137, in _run_ccdr
ccdr_result = launch_R_script(Path("{}/R_templates/CCDr.R".format(os.path.dirname(os.path.realpath(file)))),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/utils/R.py", line 221, in launch_R_script
raise RuntimeError("RProcessError \nR Process Error Output \n-----------------------\n" + str(err, "ISO-8859-1")) from None
RuntimeError: RProcessError
R Process Error Output
Loading required package: sparsebnUtils
Loading required package: ccdrAlgorithm
Loading required package: discretecdAlgorithm
sparsebn v0.1, Copyright (c) 2016-2020
Bryon Aragam, University of Chicago
Jiaying Gu, University of California, Los Angeles
Dacheng Zhang, University of California, Los Angeles
Qing Zhou, University of California, Los Angeles
Fei Fu
A list of interventions was not specified: Assuming data is purely observational.
Error in weights < -1 || weights > 1 :
'length = 324' in coercion to 'logical(1)'
Calls: estimate.dag ... -> ccdr_call -> ccdr_gridR -> ccdr_singleR
Execution halted
The text was updated successfully, but these errors were encountered:
Hello!
I am working on a project comparing various causal discovery algorithms in the Causal Discovery Toolbox (CDT).
I am encountering an error with the CCDr algorithm.
All three data types (hybrid, continuous, and discrete) didn't work. I also changed the temporary directory, which let me visibly see the temporary folder/files being created while it was processing and then immediately deleted. So, I don't think it's an access/permission issue.
Versions:
CDT package - 0.6.0
Python - 3.11.3
Pytorch - 2.0.1
No GPUs available.
You will need the following ->
Data files:
data.csv - hybrid data type
data.csv
data1.csv - continuous data type
data1.csv
data2.csv - discrete data type
data2.csv
The following Python script:
Error:
R Python Error Output
[Errno 2] No such file or directory: '/Users/oriana/CDT/CDT_Algorithms/check/cdt_ccdr_f8b6bdf0-3c90-4f35-b860-8abe44173994/result.csv'
Traceback (most recent call last):
File "/Users/oriana/CDT/CDT_Algorithms/check/CCDr.py", line 27, in
prediction = model.predict(data)
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/model.py", line 63, in predict
return self.create_graph_from_data(df_data, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/CCDr.py", line 121, in create_graph_from_data
results = self._run_ccdr(data, verbose=self.verbose)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/CCDr.py", line 142, in _run_ccdr
raise e
File "/usr/local/lib/python3.11/site-packages/cdt/causality/graph/CCDr.py", line 137, in _run_ccdr
ccdr_result = launch_R_script(Path("{}/R_templates/CCDr.R".format(os.path.dirname(os.path.realpath(file)))),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/cdt/utils/R.py", line 221, in launch_R_script
raise RuntimeError("RProcessError \nR Process Error Output \n-----------------------\n" + str(err, "ISO-8859-1")) from None
RuntimeError: RProcessError
R Process Error Output
Loading required package: sparsebnUtils
Loading required package: ccdrAlgorithm
Loading required package: discretecdAlgorithm
sparsebn v0.1, Copyright (c) 2016-2020
Bryon Aragam, University of Chicago
Jiaying Gu, University of California, Los Angeles
Dacheng Zhang, University of California, Los Angeles
Qing Zhou, University of California, Los Angeles
Fei Fu
Please cite our work! Type citation("sparsebn") for details.
---> Bugs? Please report any bugs at https://github.com/itsrainingdata/sparsebn/issues.
Attaching package: â
The following object is masked from â:
A list of interventions was not specified: Assuming data is purely observational.
Error in weights < -1 || weights > 1 :
'length = 324' in coercion to 'logical(1)'
Calls: estimate.dag ... -> ccdr_call -> ccdr_gridR -> ccdr_singleR
Execution halted
The text was updated successfully, but these errors were encountered: