8000 DOC Ensures that RandomForestRegressor passes numpydoc validation by alinealfa · Pull Request #20401 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC Ensures that RandomForestRegressor passes numpydoc validation #20401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion maint_tools/test_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@
"RadiusNeighborsRegressor",
"RadiusNeighborsTransformer",
"RandomForestClassifier",
"RandomForestRegressor",
"RandomTreesEmbedding",
"RandomizedSearchCV",
"RegressorChain",
Expand Down
13 changes: 11 additions & 2 deletions sklearn/ensemble/_forest.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ def decision_path(self, X):
n_nodes_ptr : ndarray of shape (n_estimators + 1,)
The columns from indicator[n_nodes_ptr[i]:n_nodes_ptr[i+1]]
gives the indicator value for the i-th estimator.

"""
X = self._validate_X_predict(X)
indicators = Parallel(
Expand Down Expand Up @@ -319,6 +318,7 @@ def fit(self, X, y, sample_weight=None):
Returns
-------
self : object
Fitted estimator.
"""
# Validate or convert input data
if issparse(y):
Expand Down Expand Up @@ -613,6 +613,13 @@ def feature_importances_(self):
)
@property
def n_features_(self):
"""Number of features when fitting the estimator.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I open #20414 to check the issue with sphinx and as well to discuss property formatting. We can wait to see how do we want to format property.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no problem with docstring.


Returns
-------
n_features_in_ : int
The number of features when fitting the estimator.
"""
return self.n_features_in_


Expand Down Expand Up @@ -1594,7 +1601,9 @@ class RandomForestRegressor(ForestRegressor):

See Also
--------
DecisionTreeRegressor, ExtraTreesRegressor
sklearn.tree.DecisionTreeRegressor : A decision tree regressor.
sklearn.ensemble.ExtraTreesRegressor : Ensemble of extremely randomized
tree regressors.

Notes
-----
Expand Down
0