EasyDeepLearn

What are monotonic constraints in XGBoost / LightGBM and when do you use them?

hard

Answer

  • You can force the prediction to be non-decreasing (or non-increasing) in a specified feature.
  • Useful for regulatory / business constraints: 'credit score shouldn't decrease when income goes up', 'insurance premium shouldn't drop when age increases'.
  • The algorithm restricts split choices during growth to preserve monotonicity.
  • Adds slight bias for a big interpretability + trust win.
  • Configured via monotoneconstraints=[+1,  0,  1,  ]\mathrm{monotone}_{\mathrm{constraints}} = [ + 1, \;0, \; - 1, \;] in each library.
Check yourself — multiple choice
  • They speed up training
  • Force predictions to be monotonic in a feature — useful for regulatory / trust constraints
  • They only apply to regression
  • They replace regularization

Monotone constraints enforce direction of effect per feature — great for regulated domains.

#xgboost#lightgbm#gradient-boosting#interpretability

Practise Supervised Learning

215 interview questions in this topic.

Related questions