Skip to content
ML Academy

Classical ML, validation, metrics, interpretation, debugging · insight-0187

Encode known directional relationships with monotonic constraints in gradient boosting

Evidence type
documented fact
Difficulty
medium
Roles
Data scientist, ML engineer
Industries
banking, insurance, aviation

Summary: situation, action, reason, boundary

  1. Situation

    Domain logic requires a direction (higher debt never lowers default risk, more days to departure never lowers remaining bookings), yet partial dependence wiggles against it.

  2. Action

    Set per-feature constraints (monotonic_cst in HistGradientBoosting, monotone_constraints in LightGBM or XGBoost), then compare held-out metrics and slice errors with the unconstrained model.

  3. Reason

    Constraints restrict splits so predictions move in one direction as the feature increases, holding other features fixed, which encodes knowledge and reduces noise-fitting.

  4. Boundary

    Credit, insurance pricing, demand and risk models with a strong, defensible prior direction.

Symptom or risk

Non-monotone artefacts produce indefensible individual decisions and fail model review, even with good aggregate metrics.

Exceptions

HistGradientBoosting does not support constraints for multiclass targets or categorical features.

Trade-offs

Usually a small accuracy cost for robustness and explainability; a large cost signals the prior may be wrong or confounded.

Pitfalls

Assuming marginal constraints guarantee monotone behaviour of interactions or of effects across feature combinations.

Lessons and concepts

Claims and their sources