3737Y = np .array ([1 , 2 , 2 , 2 , 1 , 0 , 1 , 1 , 1 , 0 ])
3838
3939
40- @pytest .mark .parametrize ("n_estimators" , [10 , 20 ])
40+ @pytest .mark .parametrize ("n_estimators" , [5 , 10 ])
4141@pytest .mark .parametrize (
4242 "estimator" ,
43- [
44- AdaBoostClassifier (algorithm = "SAMME" , n_estimators = 5 ),
45- AdaBoostClassifier (algorithm = "SAMME" , n_estimators = 10 ),
46- ],
43+ [AdaBoostClassifier (n_estimators = 5 ), AdaBoostClassifier (n_estimators = 10 )],
4744)
4845def test_easy_ensemble_classifier (n_estimators , estimator ):
4946 # Check classification for various parameter settings.
@@ -89,7 +86,7 @@ def test_estimator():
8986 assert isinstance (ensemble .estimator_ .steps [- 1 ][1 ], AdaBoostClassifier )
9087
9188 ensemble = EasyEnsembleClassifier (
92- 2 , AdaBoostClassifier (algorithm = "SAMME" ), n_jobs = - 1 , random_state = 0
89+ 2 , AdaBoostClassifier (), n_jobs = - 1 , random_state = 0
9390 ).fit (X_train , y_train )
9491
9592 assert isinstance (ensemble .estimator_ .steps [- 1 ][1 ], AdaBoostClassifier )
@@ -104,9 +101,7 @@ def test_bagging_with_pipeline():
104101 )
105102 estimator = EasyEnsembleClassifier (
106103 n_estimators = 2 ,
107- estimator = make_pipeline (
108- SelectKBest (k = 1 ), AdaBoostClassifier (algorithm = "SAMME" )
109- ),
104+ estimator = make_pipeline (SelectKBest (k = 1 ), AdaBoostClassifier ()),
110105 )
111106 estimator .fit (X , y ).predict (X )
112107
@@ -198,7 +193,7 @@ def test_easy_ensemble_classifier_single_estimator():
198193 clf1 = EasyEnsembleClassifier (n_estimators = 1 , random_state = 0 ).fit (X_train , y_train )
199194 clf2 = make_pipeline (
200195 RandomUnderSampler (random_state = 0 ),
201- AdaBoostClassifier (algorithm = "SAMME" , random_state = 0 ),
196+ AdaBoostClassifier (random_state = 0 ),
202197 ).fit (X_train , y_train )
203198
204199 assert_array_equal (clf1 .predict (X_test ), clf2 .predict (X_test ))
@@ -217,7 +212,7 @@ def test_easy_ensemble_classifier_grid_search():
217212 "estimator__n_estimators" : [3 , 4 ],
218213 }
219214 grid_search = GridSearchCV (
220- EasyEnsembleClassifier (estimator = AdaBoostClassifier (algorithm = "SAMME" )),
215+ EasyEnsembleClassifier (estimator = AdaBoostClassifier ()),
221216 parameters ,
222217 cv = 5 ,
223218 )
0 commit comments