How to export all node values (control values) of a Bayesian Network

The front end.
Post Reply
Ekincan
Posts: 2
Joined: Fri Dec 08, 2017 8:39 am

How to export all node values (control values) of a Bayesian Network

Post by Ekincan »

Hi,

I am using the academic version of Genie and my Bayesian Networks are quite large. In addition my Bayesian Networks are in ".net" format (I can convert them into other formats as well). I want to export each node's probability value (control value). To do this, I right click on each node and select "Node Properties", then I select the "Value" tab and copy my probability value. Since my Bayesian Network is to large, this job becomes very frustrating and time consuming. I was wondering if there is a feature or an alternative way that I can export all of the node's probability value?

Best Regards,
marek [BayesFusion]
Site Admin
Posts: 430
Joined: Tue Dec 11, 2007 4:24 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by marek [BayesFusion] »

I'm afraid the only way you can do this is by using SMILE. You can load the network, enter evidence of your case, update the network, and then query every node and output the values the way you want it. Please look at the programming tutorials -- it is actually quite simple to do.
I hope this helps.

Marek
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by shooltz[BayesFusion] »

You can actually get node values by using Learning|Validate command in GeNIe.

1. open your network.
2. use Learning|Generate Data command to create a dataset with 1 row.
3. open the generated dataset.

The Validate command at this point is available from Data|Validate when dataset window is active, or from Learning|Validate when network window is active. These two entrypoints are for the same command.

4. In the Validate dialog box, select the 'Test' mode
5. select ALL nodes as class nodes. To do it quickly, press Ctrl+A when focus is in the node list, then press space.
6. select a filename for your output file, then press OK
7. ignore the validation results, such as ROC/Validation curves and confusion matrices. You're only interested in the output file, so open it by clicking the 'Open output file' button in the validation results window.

Ignore the first N columns in the output file, where N is the number of nodes in your network. These are just copied from the 1-row dataset you've generated earlier. Also ignore the 'class' column at position N+1. Your probabilities are starting at N+2. For each node/state you'll get a probability; the name of the column will be 'nodeId_stateId', where nodeId is the identifier of the node and stateId is the outcome identifier.

Don't forget about item 6 above, otherwise your probabilities will be calculated with some evidence.
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by shooltz[BayesFusion] »

BTW, if you want to get the calculated probabilities for the specific case (evidence set), then you should prepare the dataset with appropriate values. The approach described above works for the network without any evidence. I'm not sure which scenario you described in your original post.
Ekincan
Posts: 2
Joined: Fri Dec 08, 2017 8:39 am

Re: How to export all node values (control values) of a Bayesian Network

Post by Ekincan »

shooltz wrote:You can actually get node values by using Learning|Validate command in GeNIe.

1. open your network.
2. use Learning|Generate Data command to create a dataset with 1 row.
3. open the generated dataset.

The Validate command at this point is available from Data|Validate when dataset window is active, or from Learning|Validate when network window is active. These two entrypoints are for the same command.

4. In the Validate dialog box, select the 'Test' mode
5. select ALL nodes as class nodes. To do it quickly, press Ctrl+A when focus is in the node list, then press space.
6. select a filename for your output file, then press OK
7. ignore the validation results, such as ROC/Validation curves and confusion matrices. You're only interested in the output file, so open it by clicking the 'Open output file' button in the validation results window.

Ignore the first N columns in the output file, where N is the number of nodes in your network. These are just copied from the 1-row dataset you've generated earlier. Also ignore the 'class' column at position N+1. Your probabilities are starting at N+2. For each node/state you'll get a probability; the name of the column will be 'nodeId_stateId', where nodeId is the identifier of the node and stateId is the outcome identifier.

Don't forget about item 6 above, otherwise your probabilities will be calculated with some evidence.
Thank you for the detailed explanation. Trying to understand the output file was a bit confusing. However, with explanations everything made sense and clear.

So far I have used many Bayesian Network tools and libraries, I have to admit that GeNIe is the best and the only software that was able handle my large networks. There is no doubt that GeNIe is a high quality software. I thank you again for all your help and developing such a high quality software. I will definitely use and acknowledge GeNIe in my research!

Best Regards
FatmaNur
Posts: 5
Joined: Tue Dec 12, 2017 9:27 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by FatmaNur »

When I follow these steps it only shows the probabilities column for 1 of the class nodes selected even though I select all nodes as class nodes and I do not see the "class" column. Am I doing something wrong?
If you don't see the 'class' column in the output file, only one node was used as a class node. Make sure that all items in the class node list in the dialog box with validation settings are checked (there should be a checkmark icon to the left of each node name).
marek [BayesFusion]
Site Admin
Posts: 430
Joined: Tue Dec 11, 2007 4:24 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by marek [BayesFusion] »

When I follow these steps it only shows the probabilities column for 1 of the class nodes selected even though I select all nodes as class nodes and I do not see the "class" column. Am I doing something wrong?
Hi Fatma,

I'm not sure what exactly you are doing differently but you must be -- I have just repeated the steps in the description that you have enclosed and I'm getting exactly what the description says I would. Please try again!

Marek
FatmaNur
Posts: 5
Joined: Tue Dec 12, 2017 9:27 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by FatmaNur »

marek wrote:
When I follow these steps it only shows the probabilities column for 1 of the class nodes selected even though I select all nodes as class nodes and I do not see the "class" column. Am I doing something wrong?
Hi Fatma,

I'm not sure what exactly you are doing differently but you must be -- I have just repeated the steps in the description that you have enclosed and I'm getting exactly what the description says I would. Please try again!

Marek
I was trying to do it on a Mac machine using Wine. I switched to a Windows computer and now it works! Thank you very much for your replies!
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: How to export all node values (control values) of a Bayesian Network

Post by shooltz[BayesFusion] »

Just tested this on a Mac with Wine; all steps described above worked exactly the same way as in Windows.
Post Reply