@@ -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,
@@ -140,7 +141,7 @@ def test_general_iris_lr(iris_dataset):
140141 lr_clf .fit (x_train , y_train )
141142 clf_slr = ScikitlearnLogisticRegression (model = lr_clf , clip_values = clip_values )
142143
143- lpf_slr = LowProFool (classifier = clf_slr , n_steps = 25 , eta = 0.02 , lambd = 1.5 )
144+ lpf_slr = LowProFool (classifier = clf_slr , n_steps = 2500 , eta = 0.02 , lambd = 1.5 )
144145 lpf_slr .fit_importances (x_train , y_train )
145146
146147 sample = x_valid
@@ -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,
@@ -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,
@@ -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 = "l2" )
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 = "l2" )
401+ lr_clf = LogisticRegression (penalty = None )
396402 lr_clf .fit (x_train , y_train )
397403
398404 # Dataset min-max clipping values
0 commit comments