update cpt of a node regularly

The engine.
Post Reply
Posts: 1
Joined: Tue May 17, 2022 9:03 pm

update cpt of a node regularly

Post by dhunfini »


I am very new to SMILE. I am using PySMILE to read the 'ventureBN.xdsl'. So far it works okay.
However, in my actual BN, which is created from GeNie has many nodes (about 29). I am required to update the CPT of one of the node in the BN regularly at a given time point. I have the updated data for that node stored in a .csv (Excel) file. The columns of the csv file gives the outcome probability of that node. Is there a way to do this in PySMILE? An example using the ventureBN.xdsl would be okay. Say, for example, how do I update/change cpt of the 'Forecast' node in that example?
Any help is appreciated
Site Admin
Posts: 1326
Joined: Mon Nov 26, 2007 5:51 pm

Re: update cpt of a node regularly

Post by shooltz[BayesFusion] »

To modify node's CPT, you should call set_node_definition. Refer to Tutorial 1 in SMILE Wrappers Manual - the tutorial program initializes the CPT with probabilities hardcoded into the Python source. In your case, you'll need to create an array from the CSV file, then call set_node_definition.
Post Reply