Closed serhiy-yevtushenko closed 7 months ago
Nop. That's not possible with internal functionalities. This seems like something that can be done with other packages.
I managed to get the export to BIF format as follows:
import pandas as pd
from pgmpy.readwrite import BIFWriter
# ...
df =pd.read_csv("input.csv")
# build model (will be
model = bn.structure_learning.fit(df)
model = bn.parameter_learning.fit(model, df)
writer = BIFWriter(model['model'])
writer.write_bif(filename='model.bif')
Possibly it will be good to add to the documentation for other people, who will be interested in such possibilities
Thanks! I will add to the documentation pages!
I have a following question, the answer to which I was not able to find in the documentation: is it possible after structure and parameter training to export the learned bayes network in one of common bayes network formats, like BIF, hugin or XMLBIF?