docstr: Set up the unit test by loading the dataset and training a model.
docstr_tok: ["Set","up","the","unit","test","by","loading","the","dataset","and","training","a","model","."]
code: def setUpClass(self):
      """
      Set up the unit test by loading the dataset and training a model.
      """
      if not _HAS_LIBSVM:
          # setUpClass is still called even if class is skipped.
          return
  
      # Generate some random data.
      # This unit test should not rely on scikit learn for test data.
      self.x, self.y = [], []
      random.seed(42)
      for _ in range(50):
          self.x.append([random.gauss(200, 30), random.gauss(-100, 22)])
          self.y.append(random.choice([1, 2]))
      self.y[0] = 1  # Make sure 1 is always the first label it sees
      self.y[1] = 2
      self.column_names = ["x1", "x2"]
      self.prob = svmutil.svm_problem(self.y, self.x)
  
      param = svmutil.svm_parameter()
      param.svm_type = svmutil.NU_SVC
      param.kernel_type = svmutil.LINEAR
      param.eps = 1
      param.probability = 1
  
      # Save the data and the model
      self.libsvm_model = svmutil.svm_train(self.prob, param)
  
      self.df = pd.DataFrame(self.x, columns=self.column_names)
  
imports: import random
  import tempfile
  import unittest
  import pandas
  import pytest
  from coremltools._deps import _HAS_LIBSVM, _HAS_SKLEARN, _SKLEARN_VERSION, MSG_LIBSVM_NOT_FOUND, MSG_SKLEARN_NOT_FOUND
  from coremltools.models.utils import _is_macos, _macos_version, evaluate_classifier, evaluate_classifier_with_probabilities
label_desc: Use image node_id 1 for calling the NuSVCLibSVMTest obj's underlying member method code with example usage: obj.setUpClass() without return types