BNDatabaseGenerator.bn

BNDatabaseGenerator.bn()

Get the Bayesian network used to generate the samples

Returns:

The Bayesian network

Return type:

pyagrum.BayesNet

Example

import pyagrum as gum

bn = gum.fastBN("A->B")
bn.cpt("A").fillWith([0.5, 0.5])
bn.cpt("B")[:] = [[0, 1], [1, 0]]  # B is the opposite of A
generator = gum.BNDatabaseGenerator(bn)
sorted(generator.bn().names())
# ['A', 'B']

Class

BNDatabaseGenerator