I am trying to execute the following code
from pomegranate import BayesianNetwork
import pandas as pd
X = pd.read_csv('dataframe.csv')
model = BayesianNetwork.from_samples(X, algorithm='exact')
import pickle
with open('graph.pickle', 'wb') as f:
pickle.dump(model.structure, f)
Where dataframe.csv
consists in a 5627x11 dataset of discrete random variables. If I run a fraction of this dataset, the code runs, but with the entire dataset, the kernel restarts, not even starting the function BayesianNetwork.from_samples
. What can be done to run the code in this case? Or is there a limitation to the model which cannot be changed?