class_docstr: A unittest class for testing Poisoning Attack on SVMs.
class_docstr_tok: ["A","unittest","class","for","testing","Poisoning","Attack","on","SVMs","."]
code: def setUpIRIS(cls):
      (x_train, y_train), (x_test, y_test), min_, max_ = load_iris()
      # Naturally IRIS has labels 0, 1, and 2. For binary classification use only classes 1 and 2.
      no_zero = np.where(np.argmax(y_train, axis=1) != 0)
      x_train = x_train[no_zero, :2][0]
      y_train = y_train[no_zero]
      no_zero = np.where(np.argmax(y_test, axis=1) != 0)
      x_test = x_test[no_zero, :2][0]
      y_test = y_test[no_zero]
      labels = np.zeros((y_train.shape[0], 2))
      labels[np.argmax(y_train, axis=1) == 2] = np.array([1, 0])
      labels[np.argmax(y_train, axis=1) == 1] = np.array([0, 1])
      y_train = labels
      te_labels = np.zeros((y_test.shape[0], 2))
      te_labels[np.argmax(y_test, axis=1) == 2] = np.array([1, 0])
      te_labels[np.argmax(y_test, axis=1) == 1] = np.array([0, 1])
      y_test = te_labels
      n_sample = len(x_train)
  
      order = np.random.permutation(n_sample)
      x_train = x_train[order]
      y_train = y_train[order].astype(float)
  
      x_train = x_train[: int(0.9 * n_sample)]
      y_train = y_train[: int(0.9 * n_sample)]
      train_dups = cls.find_duplicates(x_train)
      x_train = x_train[np.logical_not(train_dups)]
      y_train = y_train[np.logical_not(train_dups)]
      test_dups = cls.find_duplicates(x_test)
      x_test = x_test[np.logical_not(test_dups)]
      y_test = y_test[np.logical_not(test_dups)]
      cls.iris = (x_train, y_train), (x_test, y_test), min_, max_
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import unittest
  import numpy
  from sklearn.svm import NuSVC, SVC
  from art.attacks.poisoning import PoisoningAttackSVM
  from art.estimators.classification.scikitlearn import SklearnClassifier, ScikitlearnSVC
  from art.utils import load_iris
  from tests.utils import master_seed
  from tests.attacks.utils import backend_test_classifier_type_check_fail
label_desc: Use image node_id 3 for calling the TestSVMAttack obj's underlying member method code with example usage: obj.setUpIRIS(cls) without return types