We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am trying to poison a multiclass dataset, however, whichever poisoning strategy I use I get an error that looks like this:
ValueError: The data (x,y) has more than two classes.
or in the case of CAttackPoisoningSVM
CAttackPoisoningSVM
ValueError: input labels should be binary in {0, +1} interval
I have tried to wrap my secml classifier with CClassifierMulticlassOVA but then I get:
secml
CClassifierMulticlassOVA
NotImplementedError: We cannot poisoning that classifier
So, does secml supports the poisoning of multiclass datasets? and If yes how?
Thank you in advance.
# x_train is a np.ndarray # y_train is a np.ndarray consisting of multiple classes dataset_train = CDataset(x_train, y_train) clf = CClassifierSVM(kernel=CKernelRBF(gamma=0.001), C=1) clf.fit(dataset_train.X, dataset_train.Y) lb, ub = dataset_train.X.min(), dataset_train.X.max() solver_params = { 'eta': eps, 'max_iter': max_iter, 'eps': eps } pois_attack = CAttackPoisoningSVM(classifier=clf, training_data=dataset_train, val=dataset_train, lb=lb, ub=ub, dmax=1, solver_type='pgd', solver_params=solver_params) pois_attack.n_points = adversarial_points_indices.shape[0] pois_y_pred, pois_scores, pois_ds, f_opt = pois_attack.run(x=dataset_train.X, y=dataset_train.Y)
Output:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am trying to poison a multiclass dataset, however, whichever poisoning strategy I use I get an error that looks like this:
or in the case of
CAttackPoisoningSVM
I have tried to wrap my
secml
classifier withCClassifierMulticlassOVA
but then I get:So, does
secml
supports the poisoning of multiclass datasets? and If yes how?Thank you in advance.
Steps to reproduce
Output:
The text was updated successfully, but these errors were encountered: