Skip to content

[NOMRG] TST Use SimpleImputer instead of Imputer in test_bagging.py #11480

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

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 7 additions & 7 deletions sklearn/ensemble/tests/test_bagging.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from sklearn.model_selection import train_test_split
from sklearn.datasets import load_boston, load_iris, make_hastie_10_2
from sklearn.utils import check_random_state
from sklearn.preprocessing import Imputer
from sklearn.impute import SimpleImputer

from scipy.sparse import csc_matrix, csr_matrix

Expand Down Expand Up @@ -777,9 +777,9 @@ def test_bagging_regressor_with_missing_inputs():
for y in y_values:
regressor = DecisionTreeRegressor()
pipeline = make_pipeline(
Imputer(),
Imputer(missing_values=np.inf),
Imputer(missing_values=np.NINF),
SimpleImputer(),
SimpleImputer(missing_values=np.inf),
SimpleImputer(missing_values=np.NINF),
regressor
)
pipeline.fit(X, y).predict(X)
Expand Down Expand Up @@ -807,9 +807,9 @@ def test_bagging_classifier_with_missing_inputs():
y = np.array([3, 6, 6, 6, 6])
classifier = DecisionTreeClassifier()
pipeline = make_pipeline(
Imputer(),
Imputer(missing_values=np.inf),
Imputer(missing_values=np.NINF),
SimpleImputer(),
SimpleImputer(missing_values=np.inf),
SimpleImputer(missing_values=np.NINF),
classifier
)
pipeline.fit(X, y).predict(X)
Expand Down