synthcity.plugins.core.models.mbi.factor module

class Factor(domain, values)

Bases: object

static active(domain, structural_zeros)
create a factor that is 0 everywhere except in positions present in

‘structural_zeros’, where it is -infinity

Param

domain: the domain of this factor

Param

structural_zeros: a list of values that are not possible

condition(evidence)

evidence is a dictionary where keys are attributes, and values are elements of the domain for that attribute

copy(out=None)
datavector(flatten=True)

Materialize the data vector

exp(out=None)
expand(domain)
log(out=None)
logaddexp(other)
logsumexp(attrs=None)
max(attrs=None)
static ones(domain)
project(attrs, agg='sum')

project the factor onto a list of attributes (in order) using either sum or logsumexp to aggregate along other attributes

static random(domain)
sum(attrs=None)
transpose(attrs)
static uniform(domain)
static zeros(domain)