ConstraintRules#
- class superglm.ConstraintRules(rules: tuple[ConstraintSpec, ...] = ())#
Bases:
objectAn ordered set of fit-time shape rules, built with
&.Examples
>>> from superglm import Constraint >>> C = Constraint.fit >>> C.increasing & C.concave & C.cap(0.6, 1.8) Constraint.fit.increasing & Constraint.fit.concave & Constraint.fit.cap(0.6, 1.8)
- validate() None#
Refuse rule sets that contradict themselves or cannot be fitted.
Stretch ends are not compared here: a numeric end may be a band label of an ordered term, whose order is its declared one.
validate_stretches()compares them once the term has placed them on its axis.