8000 DOC Ensures that RandomForestRegressor passes numpydoc validation (#2… · scikit-learn/scikit-learn@427d696 · GitHub
[go: up one dir, main page]

Skip to content

Commit 427d696

Browse files
alinealfaogrisel
andauthored
DOC Ensures that RandomForestRegressor passes numpydoc validation (#20401)
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
1 parent 8e8e610 commit 427d696

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

maint_tools/test_docstrings.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@
150150
"RadiusNeighborsRegressor",
151151
"RadiusNeighborsTransformer",
152152
"RandomForestClassifier",
153-
"RandomForestRegressor",
154153
"RandomTreesEmbedding",
155154
"RandomizedSearchCV",
156155
"RegressorChain",

sklearn/ensemble/_forest.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,6 @@ def decision_path(self, X):
276276
n_nodes_ptr : ndarray of shape (n_estimators + 1,)
277277
The columns from indicator[n_nodes_ptr[i]:n_nodes_ptr[i+1]]
278278
gives the indicator value for the i-th estimator.
279-
280279
"""
281280
X = self._validate_X_predict(X)
282281
indicators = Parallel(
@@ -319,6 +318,7 @@ def fit(self, X, y, sample_weight=None):
319318
Returns
320319
-------
321320
self : object
321+
Fitted estimator.
322322
"""
323323
# Validate or convert input data
324324
if issparse(y):
@@ -613,6 +613,13 @@ def feature_importances_(self):
613613
)
614614
@property
615615
def n_features_(self):
616+
"""Number of features when fitting the estimator.
617+
618+
Returns
619+
-------
620+
n_features_in_ : int
621+
The number of features when fitting the estimator.
622+
"""
616623
return self.n_features_in_
617624

618625

@@ -1594,7 +1601,9 @@ class RandomForestRegressor(ForestRegressor):
15941601
15951602
See Also
15961603
--------
1597-
DecisionTreeRegressor, ExtraTreesRegressor
1604+
sklearn.tree.DecisionTreeRegressor : A decision tree regressor.
1605+
sklearn.ensemble.ExtraTreesRegressor : Ensemble of extremely randomized
1606+
tree regressors.
15981607
15991608
Notes
16001609
-----

0 commit comments

Comments
 (0)
0