MAINT Split Tree into a BaseTree
and a Tree
subclass to allow easier inheritance
#25119
Labels
BaseTree
and a Tree
subclass to allow easier inheritance
#25119
Summary
#24678 introduces a modularization of
Criterion
to allow different criterion to be used with the same classes.#25101 introduces a modularization of
Splitter
to allow different types of of splits to be computed.Now comes the time to also modularize the
Tree
class. A goodTree
class should enable oblique splits, causal leaf nodes (i.e. leaf nodes set differently from split nodes), quantile trees (leaf nodes set differently from split nodes) and unsupervised trees. Note another feature of causal trees is 'honesty', which should be easier to add after this issue is resolved.Proposed improvement
We will have the following improvements:
tree._add_node()
to set the split node and leaf node differently.SplitRecord
, which allows for generalizations of the SplitRecord.Tree
into generic and abstract base functions forBaseTree
and specific supervised axis-aligned functions forTree
Once the changes are made, one should verify:
tree
submodule's Cython code still builds (i.e.make clean
and thenpip install --verbose --no-build-isolation --editable .
should not error out)sklearn/tree
all passasv continuous --verbose --split --bench RandomForest upstream/main <new_branch_name>
and then for side-by-side comparisonasv compare main <new_branch_name>
Reference
As discussed in #24577 , I wrote up a doc on proposed improvements to the tree submodule that would:
cc: @jjerphan
The text was updated successfully, but these errors were encountered: