Generation of database

class pyAgrum.BNDatabaseGenerator(bn)

BNDatabaseGenerator is used to easily generate databases from a pyAgrum.BayesNet.

Parameters

bn (pyAgrum.BayesNet) – the Bayesian network used to generate data.

database()
drawSamples(nbSamples)
Parameters

nbSamples (int) –

Return type

float

log2likelihood()
Return type

float

samplesAt(row, col)
Parameters
  • row (int) –

  • col (int) –

Return type

int

samplesLabelAt(row, col)
Parameters
  • row (int) –

  • col (int) –

Return type

str

samplesNbCols()
Return type

int

samplesNbRows()
Return type

int

setAntiTopologicalVarOrder()
Return type

None

setRandomVarOrder()
Return type

None

setTopologicalVarOrder()
Return type

None

setVarOrder(*args)
Return type

None

setVarOrderFromCSV(*args)
Return type

None

toCSV(*args)
Return type

None

toDatabaseTable(useLabels=True)
to_pandas(with_labels=True)

export the samples as a pandas.DataFrame.

Parameters

with_labels (bool) – is the DataFrame full of labels of variables or full of index of labels of variables

varOrder()
Return type

object

varOrderNames()
Return type

List[str]