synthcity.plugins.core.models.mbi.domain module

class Domain(attrs, shape)

Bases: object

axes(attrs)

return the axes tuple for the given attributes

Parameters

attrs – the attributes

Returns

a tuple with the corresponding axes

canonical(attrs)

return the canonical ordering of the attributes

contains(other)

determine if this domain contains another

static fromdict(config)

Construct a Domain object from a dictionary of { attr : size } values

invert(attrs)

returns the attributes in the domain not in the list

marginalize(attrs)

marginalize out some attributes from the domain (opposite of project)

Parameters

attrs – the attributes to marginalize out

Returns

the marginalized Domain object

merge(other)

merge this domain object with another

Parameters

other – another Domain object

Returns

a new domain object covering the full domain

Example: >>> D1 = Domain([‘a’,’b’], [10,20]) >>> D2 = Domain([‘b’,’c’], [20,30]) >>> D1.merge(D2) Domain([‘a’,’b’,’c’], [10,20,30])

project(attrs)

project the domain onto a subset of attributes

Parameters

attrs – the attributes to project onto

Returns

the projected Domain object

size(attrs=None)

return the total size of the domain

sort(how='size')

return a new domain object, sorted by attribute size or attribute name

transpose(attrs)

reorder the attributes in the domain object