Constraint#

superglm.Constraint = <superglm.features.constraint._ConstraintNamespace object>#

The shape constraints a feature can carry, reached through Constraint.

Constraint.fit enforces the shape inside the fit, Constraint.postfit repairs it after an unconstrained fit; each offers increasing, decreasing, convex and concave (a ConstraintSpec). Constraint.fit also offers flat, cap(lo, hi) and max_step(up, down=None); rules join with & into ConstraintRules, and .below, .above and .within(a, b) restrict one to a stretch.

>>> from superglm import Constraint, Spline
>>> Spline(kind="ps", k=10, constraint=Constraint.fit.increasing)