Monotonic¶
monotonic
¶
Exact monotonicity constraints for the FlagGAM additive head.
This module is an ORIGINAL ADDITION and is not part of Zhao & Welsch (arXiv:2605.31189). Because each numerical feature contributes monotone step/ramp bases (tail flags, hinges, trend), sign constraints on their coefficients yield EXACT monotonicity of the additive contribution. Sign table and design notes in docs/DECISIONS.md entry 20.
MonotonicAdditiveHead
¶
MonotonicAdditiveHead(task: str, bounds: list[tuple[float | None, float | None]], C: float = 1.0, alpha: float = 1.0)
L-BFGS-B box-constrained L2 logistic (binary) or ridge (regression) head.
Drop-in for AdditiveHead when monotonic_constraints is active. Unlike
AdditiveHead, C/alpha are single floats only: CV tuning of the
constrained head is out of scope (spec routes list-valued C/alpha to the
spec default of 1.0 before construction, see estimator.py).
Source code in src/flaggam/monotonic.py
bounds_for_bases
¶
Per-basis-column box bounds implementing spec §8.2 sign constraints.