add feature_names_in_ and n_features_in_ attributes to dummy estimators#27937
Conversation
|
The PR fails on a single test because the error type is now different ( def test_quantile_strategy_empty_train():
est = DummyRegressor(strategy="quantile", quantile=0.4)
with pytest.raises(ValueError):
est.fit([], [])Not sure if I can just change the error type in the test because I am unsure what the test is actually testing (that it fails or that a specific error is raised). |
|
I think it'd make sense to fix the test, the behavior is now more consistent with the other estimators. It would need a changelog entry though. |
|
@yuanx749 can you review again? |
I just came across this PR and think it is good. But I am not a maintainer, so you need to ask a maintainer to approve. Sorry for the confusion... |
|
I see. @adrinjalali can you review? |
adrinjalali
left a comment
There was a problem hiding this comment.
This needs a test to make sure the attributes are correctly added to the estimator instance. Otherwise LGTM
|
@adrinjalali can this be merged? |
thomasjpfan
left a comment
There was a problem hiding this comment.
Thank you for the PR @tvdboom ! LGTM
Reference Issues/PRs
Fixes #27907
What does this implement/fix? Explain your changes.
Add the attributes
feature_names_in_andn_features_in_to the Dummy estimators.