FEA Categorical split support for DecisionTree*, ExtraTree*, RandomForest* and `ExtraTrees*#29437
Closed
adam2392 wants to merge 37 commits intoscikit-learn:mainfrom
Closed
FEA Categorical split support for DecisionTree*, ExtraTree*, RandomForest* and `ExtraTrees*#29437adam2392 wants to merge 37 commits intoscikit-learn:mainfrom
DecisionTree*, ExtraTree*, RandomForest* and `ExtraTrees*#29437adam2392 wants to merge 37 commits intoscikit-learn:mainfrom
Conversation
❌ Linting issuesThis PR is introducing linting issues. Here's a summary of the issues. Note that you can avoid having linting issues by enabling You can see the details of the linting issues under the
|
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
…into partition
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
Signed-off-by: Adam Li <adam2392@gmail.com>
12 tasks
This was referenced Jul 25, 2025
16 tasks
Member
Author
|
The diff here was too hard to wrangle, so I gave up and created a new PR in #33354 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issues/PRs
Supersedes #12866 #4899 and #7068 , #3346
What does this implement/fix? Explain your changes.
Implements splitting rules when categorical data is given in a decision tree classifier/regressor.
ParentInfo,SplitRecord,Node) ->_utils.pxdOpen Questions / TODO
breiman_shortcutbe part ofSplitter? It is completely unused byRandomSplitter, so it seems weird to pass in an argument that is unnecessary. Otoh, if we specialize thebreiman_shortcutonly forBestSplitter, then we need to also specialize howbreiman_shortcutis passed inBaseDecisionTree.Any other comments?
May be related to #24967
Would be nice to merge in #29458
Notes:
n_categories, so we can trim down the number of categories. I think this can be implemented last and then benchmarked to determine if this optimization is useful or not. I suspect it is since for categorical splits, there is time involved to "count the unique categories", which seems unnecessary. This is conceptually similar to tracking constant features