I am trying to model a Bayesian Network in python using Pomegranate package. The network should be learned from data. So I am using .from_samples method. However I am having trouble using the method .predict_proba() and it gives me error.
This is how I build the model:
model = BayesianNetwork.from_samples(X_train, algorithm='chow-liu')
and this is how I do prediction:
model.predict_proba(X_train)
and this is the error I get:
ValueError: Sample does not have the same number of dimensions as the model. Your help would be highly appreciated.
you should use predict() method to predict the state of the not-valued nodes.
Check the documentation for more details. Also, in the repository you can find some interesting tutorials that will help you.