Recently, I started to use UNBBayes as a black box for my ongoing project. I created and saved a BN and set some evidence and propagate them. But I need to save the network’s posterior beliefs in a separate file after propagating the evidence. This file would be the input of my project. Is it possible to save the network’s updated beliefs and how?
Last edit: Hoda 2017-01-31
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
HI;
If there is no way to save the evidence with UnBBayes, i suggest you to program it in this way :
The evidence of each node will be stored in a file , this file have this format( you can use another format)
Node=”name of the node 1”
State =high; evidence=0.4;
State =low; evidence=0.6;
End
Then in java you have to read this file in which it contains all the nodes and its evidences, So , this evidences will be stored in an LinkedList<Evidence> evidencelist (for example).
Public class Evidence {
String node;// the name of the node
LinkedList<String> States;
LinkedList<Double> evidence;
// please note that evidence .get(i) it’s the value of the state state.get(i)
/ complete the getters and the setters and the constructor /
}
to populate this "evidencelist" you have to read the file then ;
for each line three cases are possible:
case 1: the line contains the word(node) { in this case you have to extract the name of the node}
case 2: the line contains the word (state){in this case you have to extract the name of the state and its evidence ; the add add this two values to the object in wich it contains the name of the node }
case3: the line contains the word(End){
in this case you have to add the evidence of the node extract it inthe case 1 in the "evidencelist"}
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
Recently, I started to use UNBBayes as a black box for my ongoing project. I created and saved a BN and set some evidence and propagate them. But I need to save the network’s posterior beliefs in a separate file after propagating the evidence. This file would be the input of my project. Is it possible to save the network’s updated beliefs and how?
Last edit: Hoda 2017-01-31
HI;
If there is no way to save the evidence with UnBBayes, i suggest you to program it in this way :
The evidence of each node will be stored in a file , this file have this format( you can use another format)
Node=”name of the node 1”
State =high; evidence=0.4;
State =low; evidence=0.6;
End
Then in java you have to read this file in which it contains all the nodes and its evidences, So , this evidences will be stored in an LinkedList<Evidence> evidencelist (for example).
Public class Evidence {
String node;// the name of the node
LinkedList<String> States;
LinkedList<Double> evidence;
// please note that evidence .get(i) it’s the value of the state state.get(i)
/ complete the getters and the setters and the constructor /
}
to populate this "evidencelist" you have to read the file then ;
for each line three cases are possible:
case 1: the line contains the word(node) { in this case you have to extract the name of the node}
case 2: the line contains the word (state){in this case you have to extract the name of the state and its evidence ; the add add this two values to the object in wich it contains the name of the node }
case3: the line contains the word(End){
in this case you have to add the evidence of the node extract it inthe case 1 in the "evidencelist"}