Open williamagyapong opened 1 month ago
You can use the fit
method to either fit parameters given a structure, or to learn the structure and parameters jointly if no structure is provided.
Thank you very much for the quick response. I am finding it tricky to rewrite the following code, which is compatible with version 0.14.8, using the new API in version 1.0.4 with the fit
method. In this code, source
, and target
are tabular datasets:
` import pandas as pd from pomegranate import BayesianNetwork
bn = BayesianNetwork.from_samples(source, algorithm="greedy", n_jobs=1) sample = pd.DataFrame(bn.sample(n=len(target), algorithm="rejection"), columns=source.columns) ` Any guidance on how to adapt this code to the new version would be greatly appreciated.
Hello,
In version 0.14.8, it was possible to learn a Bayesian Network structure from sample data using the
from_samples
method. However, in version 1.0.4, I am unable to access this method from the network instance. If this feature is still supported, could you please advise on how to access it? If it is not currently available, I kindly request that it be included in a future update.Thank you!