let's see.
overall:
Load the net (all states of all nodes are uniform distributed).
Set the algorithm for the inference
set priors
set evidences
call UpdateBeliefs()
Collect the meaningful targets and find the max posterior
1. Set evidence for a number of nodes (for how many nodes, do you set soft evidence?, how many nodes do not receive any evidence?)
I have a net with 66 nodes. priors are set for four of them. Evidence is coming for 8 of them. all the rest are inference nodes. Real targets are 21. That means I have 21 classes where I compare the outcomes to find the max.
3. Check probabilities (how do you check them in the code? how in Genie?)
the targets only have "true"/"false" states, I search the maximuum of the "true" states.
node->Value()->GetMatrix()->Subscript(0);
In genie, I just look at the bar charts. Evidence are set by context menue for the same nodes. and the priors in the definitions.
I did not understood the diagnostic and case manager stuff... so I do not use until now.
different results for Genie and Smile
Re: different results for Genie and Smile
Why are all the states of the nodes uniformly distributed? That surprises me a bit.
You mention setting priors later for some node, why not just set these prior distributions in the nodes the network itself (as in setting the values in genie and saving the network)?
So, you have 21 class nodes, which are initialized uniformly. How do you search the maximum of the true states? You look at P(true) for all the nodes and then find the maximum?
Can you send me this network so I can have a look at it?
You mention setting priors later for some node, why not just set these prior distributions in the nodes the network itself (as in setting the values in genie and saving the network)?
So, you have 21 class nodes, which are initialized uniformly. How do you search the maximum of the true states? You look at P(true) for all the nodes and then find the maximum?
Can you send me this network so I can have a look at it?
Re: different results for Genie and Smile
I use GENIE just to build the structure of the net.
The parameter are set in the app.
The priors are calculated in real-time by in the starting time of the app. The evidence is then computed step by step and thereby set.
I can send it as private, not for the public.
You get a PN.
The parameter are set in the app.
The priors are calculated in real-time by in the starting time of the app. The evidence is then computed step by step and thereby set.
I can send it as private, not for the public.
You get a PN.
Re: different results for Genie and Smile
Actually I've spent a lot of time trying to figure out how to set up Smile to produce the same results as Genie. AFAIR, Genie uses d-separation by default. You can look through this topic: http://genie.sis.pitt.edu/forum/viewtop ... +relevance
Re: different results for Genie and Smile
Hi!
I have a naïve structure, then I set some evidence and when I update the beliefs I get different results for the target in Genie and Smile.
I am using jSMILE on Mac OSX. All my nodes are binary (T,F). Here is the code I am using:
I would greatly appreciate any help,
Arturo
I have a naïve structure, then I set some evidence and when I update the beliefs I get different results for the target in Genie and Smile.
I am using jSMILE on Mac OSX. All my nodes are binary (T,F). Here is the code I am using:
Code: Select all
import smile.Network;
public void runner() {
// [1] Read Bayes Model
Network net = new Network();
net.readFile(data/model.xdsl);
// [2] Assign evidence
net.setEvidence("Fever", "T");
net.setEvidence("Coughing", "F");
...
net.setEvidence("Headache", "F");
// [3] Update beliefs
net.updateBeliefs();
// [4] Print results
double[] aValues = net.getNodeValue("Influenza");
System.out.println("P(Influenza=T|evidence)= " + aValues[0]);
System.out.println("P(Influenza=F|evidence)= " + aValues[1]);
}
Arturo
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: different results for Genie and Smile
We won't be able to help if you don't post your network here.
Re: different results for Genie and Smile
Hi,
With the attached model, I tried the case described below and GeNIe outputs a slightly different result than SMILE:
Then my target node after updating beliefs gets these values in SMILE:
P(BC0021400=T|Evidence) = 0.0010307042208261006
P(BC0021400=F|Evidence) = 0.9989692957791738
If I repeat the same process in GeNIe, the values I get are:
P(BC0021400=T|Evidence) = 0.015945176
P(BC0021400=F|Evidence) = 0.98405482
With the attached model, I tried the case described below and GeNIe outputs a slightly different result than SMILE:
Code: Select all
//Evidence being set for Case 1
net.setEvidence("C0013404", "F");
net.setEvidence("C0015967", "F");
net.setEvidence("C0085593", "F");
net.setEvidence("C0235592", "F");
net.setEvidence("C0242429", "F");
net.setEvidence("C0008031", "F");
net.setEvidence("C0043144", "F");
net.setEvidence("C0009763", "F");
P(BC0021400=T|Evidence) = 0.0010307042208261006
P(BC0021400=F|Evidence) = 0.9989692957791738
If I repeat the same process in GeNIe, the values I get are:
P(BC0021400=T|Evidence) = 0.015945176
P(BC0021400=F|Evidence) = 0.98405482
- Attachments
-
- naiveB-influenza.xdsl
- (14.13 KiB) Downloaded 439 times
-
- Site Admin
- Posts: 1417
- Joined: Mon Nov 26, 2007 5:51 pm
Re: different results for Genie and Smile
GeNIe calculates the beliefs for BC0021400 as {0.0010307042, 0.9989693} with the evidence applied. Without the evidence the beliefs are {0.015945176, 0.98405482}, which leads me to believe that you didn't actually enter the evidence in GeNIe.
Re: different results for Genie and Smile
Oh! you're right! Actually I had to re-update the beliefs in my network to get the right values!
Thank you so much!
Thank you so much!