Repository navigation
ENH Support for monotonic trees with missing values - #27630
Conversation
|
@samronsin if you want to easily solve the problem linked to the linter, I encourage you to install Then, It will use the version used by the CI to make the reformat the file before committing. |
|
@jjerphan @glemaitre this turns out to be free thanks to a recent PR by @cakedev0 ! |
|
Hello @samronsin! 👋 Do you mean that this PR can be reviewed again? 🙂 |
|
👋 @jjerphan yes this PR (now only removing a flag and adding / updating tests) can be reviewed ! |
|
I would really like to review it, but I am not sure I will be able in the coming weeks. I warmly invite @cakedev0 (who's confortable with tree implementations and Cython) to review. |
glemaitre
left a comment
There was a problem hiding this comment.
LGTM. The missing coverage is actually in the test where it seems that we are always supporting the missing values for which we test.
You are only missing to add a fragment for the documentation as stated in the README of this folder: https://github.com/scikit-learn/scikit-learn/tree/main/doc/whats_new/upcoming_changes
I think that we can state it as an enhancement.
|
Thank you @glemaitre for the review ! I just added the fragment, referencing the heavy-lifting by #32119 |
cakedev0
left a comment
There was a problem hiding this comment.
That's very satisfying to see my previous refactor unlock this, it makes my day 😄
Minor style/simplification comments, but otherwise LGTM. We should be able to merge it quickly.
cakedev0
left a comment
There was a problem hiding this comment.
Thanks for quick iteration.
LGTM!
|
Thank you @cakedev0 for your review ! |
…missing_values Commit c01c2f6 (sparse NaN support) accidentally re-introduced the `monotonic_cst is None` guard that commit 6e9ef2b (ENH scikit-learn#27630) had removed. The correct combined condition is: allow NaN for all dense input regardless of monotonic_cst, and allow NaN for sparse input only when monotonic_cst is None. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Reference Issues/PRs
Follow up on #13649 to allow monotonic constraints on tree-based models when missing values are present (introduced in #23595 and #26391).
What does this implement/fix? Explain your changes.
Update on tests
and monotonic constraints checks to make them work with missing values, since a recent PR fixed the core issue.Any other comments?
The incompatibility was actually fixed by #32119