@@ -24,7 +24,7 @@ def imbalanced_dataset():
2424
2525
2626@pytest .mark .parametrize ("algorithm" , ["SAMME" , "SAMME.R" ])
27- @pytest .mark .filterwarnings ("ignore:The SAMME.R algorithm (the default) is " )
27+ @pytest .mark .filterwarnings ("ignore:`algorithm` parameter is deprecated in 0.12 " )
2828def test_rusboost (imbalanced_dataset , algorithm ):
2929 X , y = imbalanced_dataset
3030 X_train , X_test , y_train , y_test = train_test_split (
@@ -70,7 +70,7 @@ def test_rusboost(imbalanced_dataset, algorithm):
7070
7171
7272@pytest .mark .parametrize ("algorithm" , ["SAMME" , "SAMME.R" ])
73- @pytest .mark .filterwarnings ("ignore:The SAMME.R algorithm (the default) is " )
73+ @pytest .mark .filterwarnings ("ignore:`algorithm` parameter is deprecated in 0.12 " )
7474def test_rusboost_sample_weight (imbalanced_dataset , algorithm ):
7575 X , y = imbalanced_dataset
7676 sample_weight = np .ones_like (y )
@@ -88,3 +88,13 @@ def test_rusboost_sample_weight(imbalanced_dataset, algorithm):
8888
8989 with pytest .raises (AssertionError ):
9090 assert_array_equal (y_pred_no_sample_weight , y_pred_sample_weight )
91+
92+
93+ @pytest .mark .parametrize ("algorithm" , ["SAMME" , "SAMME.R" ])
94+ def test_rusboost_algorithm_future_warning (imbalanced_dataset , algorithm ):
95+ X , y = imbalanced_dataset
96+ rusboost = RUSBoostClassifier (algorithm = algorithm , random_state = 0 )
97+
98+ warning_msg = "`algorithm` parameter is deprecated in 0.12"
99+ with pytest .warns (FutureWarning , match = warning_msg ):
100+ rusboost .fit (X , y )
0 commit comments