execute Diagnosis tool by Jsmile

The engine.
Post Reply
samoht
Posts: 25
Joined: Wed Apr 28, 2010 1:41 pm

execute Diagnosis tool by Jsmile

Post by samoht »

Hello,

is it possible to execute the diagnosis tool using Jsmile?
I want to access the name of the best ranked test by Jsmile.

best regards
Samoht
orzech
Posts: 51
Joined: Wed Aug 04, 2010 11:40 pm

Re: execute Diagnosis tool by Jsmile

Post by orzech »

Yes, just use DiagNetwork class.
samoht
Posts: 25
Joined: Wed Apr 28, 2010 1:41 pm

Re: execute Diagnosis tool by Jsmile

Post by samoht »

Hi,

in http://genie.sis.pitt.edu/wiki/JSMILE:_ObservationInfo
there are the following methods described:
  • double getEntropy()
    void setEntropy(double entropy)
    double getCost()
    void setCost(double cost)
    double getInfoGain()
    void setInfoGain(double infoGain)
But the class ObservationInfo show me in Eclipse only the public fields for cost,, entropy and infoGain but NO getEntropy() Method and so on. And how can I access ObservationInfo from my DiagNetwork anyway?

similar not to find in the class FaultInfo:
double getProbability()
void setProbability(double probability)

samoht
samoht
Posts: 25
Joined: Wed Apr 28, 2010 1:41 pm

Re: execute Diagnosis tool by Jsmile

Post by samoht »

Hi,

I really dont know how to get infoGain for the best ranked (highest diagnostic value) test via Jsmile.
Does anybody have a code sample?

I really appreciate any help!
samoht
orzech
Posts: 51
Joined: Wed Aug 04, 2010 11:40 pm

Re: execute Diagnosis tool by Jsmile

Post by orzech »

samoht wrote:But the class ObservationInfo show me in Eclipse only the public fields for cost,, entropy and infoGain but NO getEntropy() Method and so on.
These are really Java basics. Just use observationInfo.infoGain to access individual fields.
And how can I access ObservationInfo from my DiagNetwork anyway?
You should call update() on your DiagNetwork object. For example:

diagNet.setPursuedFault(diagNet.findMostLikelyFault());
DiagResult results = diagNet.update();

// results.faults[0].probability

Good luck
samoht
Posts: 25
Joined: Wed Apr 28, 2010 1:41 pm

Re: execute Diagnosis tool by Jsmile

Post by samoht »

Hi many thanks for your relply.

yes its Java basics, but its nevertheless strange that in the Jsmile-Api-documentation are setters and getters mentioned which dont exist.

But another question: How can I set the entropy-cost-ratio? (as I do manually by moving the slider).

Can I do like this:
DiagResults diagResults = diagNet.update();
diagResults.observations[0].entropy = <entropy>;
diagResults.observations[0].cost = <cost>;

But I just want to determine thé ratio not the values for cost and entropy .

eAnd Do I have to call then again:
DiagResults diagResults = diagNet.update();
to get the infogain-value fitting to the entropy-cost-ratio with
infogain = diagResults.observations[0].infofgain ?


Another question:
Do i have to call both:
diagNet.update(); and
net.updateBeliefs(); ?


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

Re: execute Diagnosis tool by Jsmile

Post by shooltz[BayesFusion] »

samoht wrote:But another question: How can I set the entropy-cost-ratio? (as I do manually by moving the slider).

Can I do like this:
DiagResults diagResults = diagNet.update();
diagResults.observations[0].entropy = <entropy>;
diagResults.observations[0].cost = <cost>;
The C++ methods for setting/getting the entropy/cost ratio are not exposed through jSMILE. However, they're internally setting the user property named DIAG_alphaValue on the network object (and this is not likely to change soon). Effectively, you can work around the lack of explicit jSMILE functionality related to entropy/cost ration with Network.getUserProperties and Network.setUserProperties. Note that this is stored in Network, not DiagNetwork. The ratio is read from the Network object when DiagNetwork is created.
Another question:
Do i have to call both:
diagNet.update(); and
net.updateBeliefs();
No, the DiagNetwork.update does all the work.
Post Reply