Description
Description
I am following the 'A first CausalNex tutorial' notebook using a custom dataset JupyterLab. I encountered different issues. I was able to solve some of them.
- Error : ValueError: The given structure is not acyclic. Please review the following cycle: ('A0', 'A1'), ('A1', 'A0')]
- Error: #KeyError: 'A0'
- Kernel crashes on run fit_cpds with train data
Context
I am trying to adapt this to my project
Steps to Reproduce
data:
import numpy as np
import pandas as pd
np.random.seed(123)
data=pd.DataFrame({'A'+str(key):np.random.choice([0,1],size=(1000,)) for key in range(181)})
sm = from_pandas(data,use_gpu=True)
Processes
bn = BayesianNetwork(sm) # this yielded the first error, this was corrected by removing those affected connections
bn = bn.fit_cpds(test, method="BayesianEstimator", bayes_prior="K2") # this yileded the second error, it was fixed by running the fit_node_states on the data prior to this step
Running fit_cpds again crashed the kernel
Expected Result
Expected a similar output to the tutorial
Actual Result
Canceled future for execute_request message before replies were done
The Kernel crashed while executing code in the the current cell or a previous cell. Please review the code in the cell(s) to identify a possible cause of the failure. Click here for more info. View Jupyter log for further details.
`
Your Environment
- CausalNex version used: 0.11.0
- Python version used: 3.8.13
- Operating system and version: Ubuntu 20.04.4 LTS, running in an Anaconda virtual environment