Enable diagnosis for nodes using pysmile wrapper

The engine.
Post Reply
hemasadhasivam
Posts: 6
Joined: Mon Apr 20, 2020 8:53 am

Enable diagnosis for nodes using pysmile wrapper

Post by hemasadhasivam » Tue Jun 02, 2020 10:24 pm

Hello
I am using PySmile wrapper to generate a network.

1. I want to enable diagnosis for the created nodes through code.
I checked the various methods and found the below snippet relevant to what I am looking for.

Code: Select all

net = PySmile.Network()
net.set_node_diag_type(handle, int)
But the input arguments accepted by the "set_node_diag_type" method are not very clear and I couldn't find information related to the diagnostic role of a node in the documentation. What does the second 'int' parameter indicate?
It would be very helpful if you could provide some information.

Additional note: I want some of the nodes in my network to be of target type and the others to be observation type and that is the reason why I am looking to use the set_node_diag_type method.

2. Is it possible to change the font type or size through PySmile wrapper?

3. Are there methods to convert the graph to a bar view or an icon view?

Thanks & Regards,
Hema S

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

Re: Enable diagnosis for nodes using pysmile wrapper

Post by shooltz[BayesFusion] » Wed Jun 03, 2020 10:37 pm

2. Is it possible to change the font type or size through PySmile wrapper?
3. Are there methods to convert the graph to a bar view or an icon view?
Unfortunately, this functionality is not available from PySMILE.

We will write a sample Python program using PySMILE's diagnostic functionality and post it here.

piotr [BayesFusion]
Site Admin
Posts: 25
Joined: Mon Nov 06, 2017 6:41 pm

Re: Enable diagnosis for nodes using pysmile wrapper

Post by piotr [BayesFusion] » Thu Jun 04, 2020 9:03 am

First argument of set_node_diag_type method is node handle or node ID. Second argument represents diagnostic type. By default, all nodes are Auxiliary.

You can change diagnostic type by calling e.g.

Code: Select all

net.set_node_diag_type("Fault Node ID", pysmile.NodeDiagType.FAULT)
net.set_node_diag_type("First Observation Node", pysmile.NodeDiagType.OBSERVATION)
net.set_node_diag_type("Second Observation Node", pysmile.NodeDiagType.OBSERVATION)
Besides of that, at least one state of fault node must be marked as "fault outcome".

Code: Select all

net.set_fault_outcome("Fault Node ID", "Fault Outcome", True)
Ranked observations could be setted with method net.set_ranked:

Code: Select all

net.set_ranked("First Observation Node", True)
Then, you can run diagnosis with creating DiagNetwork object and running update method.

Code: Select all

diag_net = pysmile.DiagNetwork(net)
diag_result = diag_net.update()

hemasadhasivam
Posts: 6
Joined: Mon Apr 20, 2020 8:53 am

Re: Enable diagnosis for nodes using pysmile wrapper

Post by hemasadhasivam » Mon Jun 08, 2020 11:36 pm

Thank you for the update. It's very helpful.

Post Reply