Repository navigation
ENH Monotonic Contraints for Tree-based models - #13649
Conversation
DecisionTrees RandomForests GradientBoosting
|
Very interested in this, please ping me when you have something! |
|
I added a few tests to check that the implementation actually enforced the monotonicity constraints, but they are failing... |
|
Two issues:
|
|
@samronsin LMK when you need reviews. I've implemented monotonic constraints for the hist-GBDTs in #15582 It's still under review so your comments are more than welcome there. I think you'll also find some tests worth using. They helped me a great deal in debugging my code |
Yes. Maybe this be done by just reversing the constraint? Not sure
You don't seem to be constraining the values of the children based on the average value of a pair of siblings. You'll need to introduce lower and upper bounds to the nodes values for monotonic constraints to be properly enforced (see https://github.com/scikit-learn/scikit-learn/pull/15582/files#diff-9bd2ee07fb6817a0aee54f959d32de8aR139). |
65c0ad0 to
16a8863
Compare
ogrisel
left a comment
There was a problem hiding this comment.
LGTM! Thank you very much @samronsin!
Signed-off-by: Julien Jerphanion <[email protected]>
jjerphan
left a comment
There was a problem hiding this comment.
LGTM! Thank you for your notable contribution, your persistence, and your patience, @samronsin.
@lorentzenchr: are you interested in having a look at this PR before merging it?
|
Thank you @jjerphan, @ogrisel and @NicolasHug for your invaluable help on this PR ! Very happy to see this work landing eventually ! |
|
At yesterday's monthly meeting, we mentioned that it would be appropriate to test data structure consistency between HGBT's and DecisionTree's when constraints of monotonicity are used. I think we better do it in a subsequent PR. I will merge this PR on Friday if no-one objects in the meantime. |
|
I would wait for @lorentzenchr's approval before merging. |
|
🎉 |
Co-authored-by: Pat O'Reilly <[email protected]> Co-authored-by: dsleo <[email protected]> Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]> Co-authored-by: Julien Jerphanion <[email protected]>
Co-authored-by: Pat O'Reilly <[email protected]> Co-authored-by: dsleo <[email protected]> Co-authored-by: Olivier Grisel <[email protected]> Co-authored-by: Thomas J. Fan <[email protected]> Co-authored-by: Julien Jerphanion <[email protected]>
Continuation of PR #7266 addressing issue #6656 and #18982.
TODO:
implement logic for new trees in [MRG+2] Faster Gradient Boosting Decision Trees with binned features #12807(already done by [MRG] Monotonic constraints for GBDT #15582)increasinganddecreasing) => let's go with themontonic_cstarray