How can I manipulate the way conditional probability table is formatted? #5
-
Suppose I have some random BN generated and I generate some conditional probability table using For example, here I attached an example, let's say I want to have B to be where D is always for any given bn.cpt() whenever B exists in the cpt. Is there a way to do that for any given cpt? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Hi @kenneth-lee-ch , Is this what you want to do ? (I do not really understand what you mean by"given a string") Note that when the Potential is on a white background, it means that it is not a CPT anymore :-) |
Beta Was this translation helpful? Give feedback.
-
@phwuil I am just thinking about how to get the conditional probability given any target and conditioning set from a CPT and be able to output a prediction according to the largest probability given a sample. I was thinking to get |
Beta Was this translation helpful? Give feedback.
-
It is a
Moreover, it performs this d-separation analysis... And it takes advantage of aGrUM's ability to make incremental inferences: some computations can be factored. Such that an |
Beta Was this translation helpful? Give feedback.
-
@phwuil I have a follow-up question. If I use The reason why I want to do that is that I want to get a list of values (0 and 1) according to the max value of a specific variable in the table. For example, in the screenshot, if my specific variable is W, then I would get all 0's as the list of values because 0 always corresponds to the higher probability in this case. |
Beta Was this translation helpful? Give feedback.
-
Hi @kenneth-lee-ch , you have two methods of Potential to do so : By the way, if I well understood what you would like : |
Beta Was this translation helpful? Give feedback.
It is a
getPosterior
for all the possible configurations of the variables in the evidence.getPosterior
: P(X |Y=1,Z=0)evidenceImpact
: the whole P(X|Y=y,Z=z) forall y,zMoreover, it performs this d-separation analysis...
And it takes advantage of aGrUM's ability to make incremental inferences: some computations can be factored. Such that an
evidenceImpact
if faster than severalgetPosterior
s.