-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
TST avoid FutureWarning due to n_features_in_ deprecation in Dummy* #20963
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
TST avoid FutureWarning due to n_features_in_ deprecation in Dummy* #20963
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I will let you merge this time lol
@@ -615,6 +615,7 @@ def fit(self, X, y, sample_weight=None, **fit_params): | |||
return super().fit(X, y, sample_weight) | |||
|
|||
|
|||
@pytest.mark.filterwarnings("ignore:`n_features_in_` is deprecated") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is worrying me. Here, it shows that a user will see the warning for some meta-estimators using the dummy estimator. Indeed, for the meta-estimators setting n_features_in_
depending on the inner estimator, we will check n_features_in_
and it will raise the warning with the dummy estimators.
It might be less of a big deal because it is only a dummy estimator and maybe not that many people are using it in a meta-estimator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it gets annoying for users, we can define our own hasattr
that ignores future warnings emitted by sklearn.
Edit: Most likely better to use a @property
and @available_if
. (If @available_if
works with properties)
Let see if the CIs are passing first :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
follow-up #20960
Removing the warning issued due to the deprecation of
n_features_in_
inDummy*
.