[Refactor, Tree] Python tree class for modularity and consistency of BaseEstimator #24746
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
Addresses the Python interface issue in #24000
Also is a follow up to refactoring of Criterion in #24678
This should be reviewed and merged after #24678
What does this implement/fix? Explain your changes.
This implements a change to the
BaseDecisionTree
class to enable i) consistency with the assumptions of aBaseEstimator
and ii) modularity for subclassing of theBaseDecisionTree
class.consistency:
y=None
is now the default infit()
, which is in line w/ the assumptions of aBaseEstimator
that is not supervised/unsupervised yet. This enables someone to subclassBaseDecisionTree
and define a completely unsupervised tree as described in [RFC] Modularize 'Criterion' class inside tree submodule to allow 3rd party extensions for data-based criterion #24577modularity:
_set_criterion()
,_set_splitter()
, and_set_tree()
. As demonstrated in FEA Add Oblique trees and oblique splitters to tree module: Enables extensibility of the trees #22754 any subclass of the Tree and Splitter class is sufficient to build up a tree using the existing TreeBuilder cython class.Any other comments?
n/a