Skip to content

Commit 5b7ce7e

Browse files
committed
Merging main
Signed-off-by: Adam Li <adam2392@gmail.com>
1 parent be902cc commit 5b7ce7e

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

sklearn/tree/_classes.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,6 +1386,16 @@ class DecisionTreeRegressor(RegressorMixin, BaseDecisionTree):
13861386
13871387
.. versionadded:: 0.22
13881388
1389+
store_leaf_values : bool, default=False
1390+
Whether to store the samples that fall into leaves in the ``tree_`` attribute.
1391+
Each leaf will store a 2D array corresponding to the samples that fall into it
1392+
keyed by node_id.
1393+
1394+
XXX: This is currently experimental and may change without notice.
1395+
Moreover, it can be improved upon since storing the samples twice is not ideal.
1396+
One could instead store the indices in ``y_train`` that fall into each leaf,
1397+
which would lower RAM/diskspace usage.
1398+
13891399
Attributes
13901400
----------
13911401
feature_importances_ : ndarray of shape (n_features,)
@@ -1713,6 +1723,16 @@ class ExtraTreeClassifier(DecisionTreeClassifier):
17131723
17141724
.. versionadded:: 0.22
17151725
1726+
store_leaf_values : bool, default=False
1727+
Whether to store the samples that fall into leaves in the ``tree_`` attribute.
1728+
Each leaf will store a 2D array corresponding to the samples that fall into it
1729+
keyed by node_id.
1730+
1731+
XXX: This is currently experimental and may change without notice.
1732+
Moreover, it can be improved upon since storing the samples twice is not ideal.
1733+
One could instead store the indices in ``y_train`` that fall into each leaf,
1734+
which would lower RAM/diskspace usage.
1735+
17161736
Attributes
17171737
----------
17181738
classes_ : ndarray of shape (n_classes,) or list of ndarray
@@ -1959,6 +1979,16 @@ class ExtraTreeRegressor(DecisionTreeRegressor):
19591979
19601980
.. versionadded:: 0.22
19611981
1982+
store_leaf_values : bool, default=False
1983+
Whether to store the samples that fall into leaves in the ``tree_`` attribute.
1984+
Each leaf will store a 2D array corresponding to the samples that fall into it
1985+
keyed by node_id.
1986+
1987+
XXX: This is currently experimental and may change without notice.
1988+
Moreover, it can be improved upon since storing the samples twice is not ideal.
1989+
One could instead store the indices in ``y_train`` that fall into each leaf,
1990+
which would lower RAM/diskspace usage.
1991+
19621992
Attributes
19631993
----------
19641994
max_features_ : int

0 commit comments

Comments
 (0)