You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All attributes with trailing underscore must be set up at the end of the fit() functionality, when we are sure that all fit logic worked. At the moment, it is not like that for all transformers.
Add a test like the one in test_encoders:
@pytest.mark.parametrize("estimator", _estimators)
def test_raises_non_fitted_error_when_error_during_fit(estimator):
X, y = test_df(categorical=True)
X.loc[len(X) - 1] = nan
transformer = clone(estimator)
with pytest.raises(ValueError):
transformer.fit(X, y)
# Test when fit is not called prior to transform.
with pytest.raises(NotFittedError):
transformer.transform(X)
Modules encoding and preprocessing already have this functionality.
The text was updated successfully, but these errors were encountered:
solegalli
changed the title
test that if fit fails, then the transformer also fails the non_fitted_error
ensure that all attributes with trailing underscore in fit are leared after the entire logic has succeded
Jan 14, 2023
All attributes with trailing underscore must be set up at the end of the fit() functionality, when we are sure that all fit logic worked. At the moment, it is not like that for all transformers.
Add a test like the one in test_encoders:
Modules encoding and preprocessing already have this functionality.
The text was updated successfully, but these errors were encountered: