Diagnostic session

<< Click to Display Table of Contents >>

Navigation:  Using SMILE Wrappers > Diagnosis >

Diagnostic session

With diagnostic attributes, such as node roles and (optionally) observation costs defined, we can start a diagnostic session in order to obtain a ranked observation list. The diagnostic session is represented by DiagNetwork object. Its constructor requires a reference to the Network object, where diagnostic information is defined. The session object provides an API to pursue faults, instantiate observations, and retrieve the statistics for observations. During the diagnostic session, your program should use the DiagNetwork instance to read information from the network.

Java:

DiagNetwork diagNet = new DiagNetwork(net);

Python:

diagnet = pysmile.DiagNetwork(net)

R:

diagNet <- DiagNetwork(net)

C#:

DiagNetwork diagNet = new DiagNetwork(net);

The diagnostic session instantiates the mandatory observation during its initialization. To obtain a ranking of uninstantiated observations, we need to calculate their diagnostic value, which is a dynamic measure, depending on the already instantiated observations and the fault or faults selected as the focus of reasoning (these faults are called "pursued faults"). By default, the pursued fault is the one which is most likely.

From the diagnostic session point of view, the fault is a node/state pair (because one fault node can have more than one faulty state). The node/state pairs are referenced by their indices. Do not use fault node handles directly when setting the pursued fault. To convert the node handle/state pair to fault index, use DiagNetwork.getFaultIndex. To change the pursued fault, use DiagNetwork.setPursuedFault, or setPursuedFaults if more than one fault is to be pursued.

During the diagnostic session, the observation nodes can be set to evidence with calls to DiagNetwork.instantiateObservation. Do not call Network.setEvidence directly during the diagnostic session, as it will make the internal session state inconsistent. Instantiated observation can be reset to unobserved with Network.releaseObservation, which calls Network.clearEvidence internally.

After selecting the pursued faults and instantiating known observations, the application can call DiagNetwork.update to obtain the DiagResults object, which contains two arrays:

DiagResults.faults contains an entry for each fault node in the network. Each entry includes the probability of the fault state in its probability member. The array is sorted by fault probability in the descending order.

DiagResults.observations contains an entry for each uninstantiated observation node in the network. Each entry includes the diagnostic measure for the observation in its measure member, and the infoGain member contains effective measure combined with the observation cost. If there's no cost defined, infoGain is equal to measure. The array is sorted by the value of infoGain in the descending order.

The typical diagnostic program is interactive, starting with single pursued fault and no instantiated observations other than the ones with default value. The application user changes the pursued faults, and instantiates observations taking into account the diagnostic values of the observations displayed in the UI.