BNDatabaseGenerator.samplesLabelAt
- BNDatabaseGenerator.samplesLabelAt(row, col)
Get the label of the database in (row,col)
- Parameters:
row (
int) – the rowcol (
int) – the column (using the ordered list of variables)
- Returns:
the label of the modality of the variable in this position
- Return type:
str
Example
import pyagrum as gum
bn = gum.fastBN("A{yes|no}->B{low|high}")
bn.cpt("A").fillWith([0.5, 0.5])
bn.cpt("B")[:] = [[0, 1], [1, 0]] # B is "high" iff A is "yes"
generator = gum.BNDatabaseGenerator(bn)
ll = generator.drawSamples(5, {"A": "yes"})
generator.samplesLabelAt(0, 0), generator.samplesLabelAt(0, 1)
# ('yes', 'high')
Class