BootstrapMixture.add

BootstrapMixture.add(name, bn, w=1)

Adds a BN to the model. If the model has no reference BN yet (an empty pyagrum.bnmixture.BNMixture), a copy of the added BN becomes the reference; adding other BNs does not change it (see pyagrum.bnmixture.BNMixture.updateRef).

Parameters:
  • name (str) – Name of the BN to add.

  • bn (pyagrum.BayesNet) – BN to add.

  • w (float) – Weight of the BN.

Raises:
Return type:

None

Example

import pyagrum as gum
import pyagrum.bnmixture as bnm

mix = bnm.BootstrapMixture("ref", gum.fastBN("A->B->C"))
mix.add("bn1", gum.fastBN("A->B->C"))
mix.add("bn2", gum.fastBN("A->B;A->C"))
mix.add("bn3", gum.fastBN("C->B->A"), w=1)
mix.names()
# ['bn1', 'bn2', 'bn3']

Class

BootstrapMixture