def test_general_cancer_svc(breast_cancer_dataset):
    """
    Check whether the produced adversaries are correct,
    given SVC and breast cancer wisconsin dataset.
    """
    (x_train, y_train, x_valid, y_valid), _, clip_values = breast_cancer_dataset

    svc_clf = SVC()
    svc_clf.fit(x_train, y_train)
    scaled_clip_values_cancer = (-1.0, 1.0)
    clf_svc = ScikitlearnSVC(model=svc_clf, clip_values=scaled_clip_values_cancer)
    lpf_svc = LowProFool(classifier=clf_svc, n_steps=15, eta=15, lambd=1.75, eta_decay=0.985, verbose=False)
    lpf_svc.fit_importances(x_train, y_train)
    n_classes = lpf_svc.n_classes
    targets = np.eye(n_classes)[
        np.array(y_valid.apply(lambda x: np.random.choice([i for i in range(n_classes) if i != x])))
    ]
    # Generate adversaries
    adversaries = lpf_svc.generate(x=x_valid, y=targets)

    # Check the success rate
    expected = np.argmax(targets, axis=1)
    predicted = np.argmax(clf_svc.predict(adversaries), axis=1)
    correct = expected == predicted

    success_rate = np.sum(correct) / correct.shape[0]
    expected = 0.6

    logger.info(
        "[Breast cancer, Scikit-learn SVC] success rate of adversarial attack (expected >{:.2f}): "
        "{:.2f}%".format(expected * 100, success_rate * 100)
    )
    assert success_rate > expected

    Check whether the produced adversaries are correct,
    given SVC and breast cancer wisconsin dataset.
    
tests/attacks/evasion/test_lowprofool.py