class_docstr: Unit test class for testing xgboost converter.
class_docstr_tok: ["Unit","test","class","for","testing","xgboost","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.
      """
      from sklearn.datasets import load_boston
      import numpy as np
  
      scikit_data = load_boston()
      t = scikit_data.target
      target = np.digitize(t, np.histogram(t)[1]) - 1
      dtrain = xgboost.DMatrix(
          scikit_data.data,
          label=target,
          feature_names=scikit_data.feature_names,
      )
      self.xgb_model = xgboost.train({}, dtrain)
      self.target = target
  
      # Save the data and the model
      self.scikit_data = scikit_data
      self.n_classes = len(np.unique(self.target))
  
imports: import unittest
  import tempfile
  import json
  from sklearn.ensemble import GradientBoostingClassifier
  from coremltools.converters import sklearn
  from coremltools.proto import Model_pb2
  from coremltools.proto import FeatureTypes_pb2
  from coremltools._deps import _HAS_XGBOOST
  from coremltools._deps import _HAS_SKLEARN
label_desc: Use image node_id 1 for calling the GradientBoostingMulticlassClassifierXGboostTest obj's underlying member method code with example usage: obj.setUpClass() without return types