mbi.Constraint
- class mbi.Constraint(domain: Domain, valid: ndarray | None = None, invalid: ndarray | None = None, mapping: ndarray | None = None)[source]
Bases:
objectA structural constraint on allowed value combinations.
Exactly one of
valid,invalid, ormappingmust be specified.- domain
The sub-domain this constraint covers.
- Type:
- valid
Array of shape
(n, len(domain))listing allowed combos.- Type:
numpy.ndarray | None
- invalid
Array of shape
(n, len(domain))listing forbidden combos.- Type:
numpy.ndarray | None
- mapping
Array of shape
(domain.shape[0],)defining a functional dependency from the first attribute (fine) to the second (coarse). Requires exactly two attributes in the domain.- Type:
numpy.ndarray | None
Methods
__init__Attributes
Sorted attribute names, for junction tree construction.
Whether this constraint is a functional dependency.
0 for allowed, -inf for forbidden.
- valid: ndarray | None = None
- invalid: ndarray | None = None
- mapping: ndarray | None = None
- property clique: tuple[str | int, ...]
Sorted attribute names, for junction tree construction.
- property is_deterministic: bool
Whether this constraint is a functional dependency.