class_docstr: Unit test class for testing scikit-learn converter.
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","."]
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_SKLEARN:
          return
      if not _HAS_LIBSVM:
          return
  
      scikit_data = load_boston()
      prob = svmutil.svm_problem(
          scikit_data["target"] > scikit_data["target"].mean(),
          scikit_data["data"].tolist(),
      )
      param = svmutil.svm_parameter()
      param.svm_type = svmutil.C_SVC
      param.kernel_type = svmutil.LINEAR
      param.eps = 1
  
      libsvm_model = svmutil.svm_train(prob, param)
      libsvm_spec = libsvm_converter.convert(
          libsvm_model, scikit_data.feature_names, "target"
      ).get_spec()
  
      # Save the data and the model
      self.scikit_data = scikit_data
      self.libsvm_spec = libsvm_spec
  
imports: import unittest
  import tempfile
  from coremltools.proto import FeatureTypes_pb2
  from coremltools._deps import _HAS_SKLEARN, _HAS_LIBSVM
  from coremltools.models.pipeline import PipelineRegressor, PipelineClassifier
  from coremltools.models.utils import evaluate_transformer
  import coremltools.models.datatypes
  from coremltools.models.feature_vectorizer import create_feature_vectorizer
label_desc: Use image node_id 1 for calling the LibSVMPipelineCreationTest obj's underlying member method code with example usage: obj.setUpClass() without return types