@@ -128,6 +128,7 @@ def train_nn(self, nn_model, x, y, learning_rate, epochs):
128128 optimizer .step ()
129129
130130
131+ @pytest .mark .only_with_platform ("scikitlearn" )
131132def test_general_iris_lr (iris_dataset ):
132133 """
133134 Check whether the produced adversaries are correct,
@@ -136,7 +137,7 @@ def test_general_iris_lr(iris_dataset):
136137 (x_train , y_train , x_valid , y_valid ), _ , clip_values = iris_dataset
137138
138139 # Setup classifier.
139- lr_clf = LogisticRegression (penalty = "none" )
140+ lr_clf = LogisticRegression (penalty = None )
140141 lr_clf .fit (x_train , y_train )
141142 clf_slr = ScikitlearnLogisticRegression (model = lr_clf , clip_values = clip_values )
142143
@@ -170,6 +171,7 @@ def test_general_iris_lr(iris_dataset):
170171 _ = lpf_slr .generate (x = np .ones ((sample .shape [0 ], 11 )), y = target )
171172
172173
174+ @pytest .mark .only_with_platform ("scikitlearn" )
173175def test_general_wines_lr (wine_dataset ):
174176 """
175177 Check whether the produced adversaries are correct,
@@ -178,7 +180,7 @@ def test_general_wines_lr(wine_dataset):
178180 (x_train , y_train , x_valid , y_valid ), _ , clip_values = wine_dataset
179181
180182 # Setup classifier
181- lr_clf = LogisticRegression (penalty = "none" )
183+ lr_clf = LogisticRegression (penalty = None )
182184 lr_clf .fit (x_train , y_train )
183185 clf_slr = ScikitlearnLogisticRegression (model = lr_clf , clip_values = clip_values )
184186
@@ -204,6 +206,7 @@ def test_general_wines_lr(wine_dataset):
204206 assert success_rate > expected
205207
206208
209+ @pytest .mark .only_with_platform ("scikitlearn" )
207210def test_general_cancer_lr (breast_cancer_dataset ):
208211 """
209212 Check whether the produced adversaries are correct,
@@ -212,7 +215,7 @@ def test_general_cancer_lr(breast_cancer_dataset):
212215 (x_train , y_train , x_valid , y_valid ), _ , clip_values = breast_cancer_dataset
213216
214217 # Setup classifier
215- lr_clf = LogisticRegression (penalty = "none" )
218+ lr_clf = LogisticRegression (penalty = None )
216219 lr_clf .fit (x_train , y_train )
217220 clf_slr = ScikitlearnLogisticRegression (model = lr_clf , clip_values = clip_values )
218221
@@ -281,6 +284,7 @@ def test_general_iris_nn(iris_dataset):
281284 assert success_rate > expected
282285
283286
287+ @pytest .mark .only_with_platform ("scikitlearn" )
284288def test_general_cancer_svc (breast_cancer_dataset ):
285289 """
286290 Check whether the produced adversaries are correct,
@@ -316,6 +320,7 @@ def test_general_cancer_svc(breast_cancer_dataset):
316320 assert success_rate > expected
317321
318322
323+ @pytest .mark .only_with_platform ("scikitlearn" )
319324def test_fit_importances (iris_dataset ):
320325 """
321326 Check whether feature importance is calculated properly.
@@ -329,7 +334,7 @@ def pearson_correlations(x, y):
329334 return result
330335
331336 # Setup classifier
332- lr_clf = LogisticRegression (penalty = "none" )
337+ lr_clf = LogisticRegression (penalty = None )
333338 lr_clf .fit (x_train , y_train )
334339 clf_slr = ScikitlearnLogisticRegression (model = lr_clf , clip_values = clip_values )
335340
@@ -385,14 +390,15 @@ def pearson_correlations(x, y):
385390 assert is_vec_fit_valid
386391
387392
393+ @pytest .mark .only_with_platform ("scikitlearn" )
388394def test_clipping (iris_dataset ):
389395 """
390396 Check weather adversaries are clipped properly.
391397 """
392398 (x_train , y_train , x_valid , y_valid ), _ , clip_values = iris_dataset
393399
394400 # Setup classifier
395- lr_clf = LogisticRegression (penalty = "none" )
401+ lr_clf = LogisticRegression (penalty = None )
396402 lr_clf .fit (x_train , y_train )
397403
398404 # Dataset min-max clipping values
0 commit comments