8000 FIX sphinx warning on @deprecated n_features_ property by ogrisel · Pull Request #20418 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

FIX sphinx warning on @deprecated n_features_ property #20418

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
8 changes: 4 additions & 4 deletions sklearn/tree/_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,8 +1016,8 @@ def predict_log_proba(self, X):
return proba

@deprecated( # type: ignore
"The attribute 'n_features_' is deprecated in 1.0 and will be removed "
"in 1.2. Use 'n_features_in_' instead."
"The attribute `n_features_` is deprecated in 1.0 and will be removed "
"in 1.2. Use `n_features_in_` instead."
)
@property
def n_features_(self):
Expand Down Expand Up @@ -1336,8 +1336,8 @@ def _compute_partial_dependence_recursion(self, grid, target_features):
return averaged_predictions

@deprecated( # type: ignore
"The attribute 'n_features_' is deprecated in 1.0 and will be removed "
"in 1.2. Use 'n_features_in_' instead."
"The attribute `n_features_` is deprecated in 1.0 and will be removed "
"in 1.2. Use `n_features_in_` instead."
)
@property
def n_features_(self):
Expand Down
4 changes: 2 additions & 2 deletions sklearn/tree/tests/test_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -2527,8 +2527,8 @@ def test_n_features_deprecated(Tree):
# check that we raise a deprecation warning when accessing `n_features_`.
# FIXME: remove in 1.2
depr_msg = (
"The attribute 'n_features_' is deprecated in 1.0 and will be "
"removed in 1.2. Use 'n_features_in_' instead."
"The attribute `n_features_` is deprecated in 1.0 and will be "
"removed in 1.2. Use `n_features_in_` instead."
)

with pytest.warns(FutureWarning, match=depr_msg):
Expand Down
0