class_docstr: Unit test class for testing xgboost converter.
class_docstr_tok: ["Unit","test","class","for","testing","xgboost","converter","."]
code: def test_conversion_from_file(self):
      import numpy as np
  
      output_name = "target"
      feature_names = self.scikit_data.feature_names
  
      xgb_model_json = tempfile.mktemp("xgb_tree_model_classifier.json")
      xgb_json_out = self.xgb_model.get_dump(
          with_stats=True, dump_format="json"
      )
      with open(xgb_model_json, "w") as f:
          json.dump(xgb_json_out, f)
      spec = xgb_converter.convert(
          xgb_model_json,
          feature_names,
          output_name,
          mode="classifier",
          n_classes=self.n_classes,
      ).get_spec()
      self.assertIsNotNone(spec)
  
      # Test the model class
      self.assertIsNotNone(spec.description)
      self.assertIsNotNone(spec.treeEnsembleRegressor)
  
      # Test the interface class
      self.assertEqual(
          spec.description.predictedFeatureName, output_name
      )
  
      # Test the inputs and outputs
      self.assertEqual(len(spec.description.output), 2)
      self.assertEqual(spec.description.output[0].name, output_name)
      self.assertEqual(
          spec.description.output[0].type.WhichOneof("Type"),
          "int64Type",
      )
      for input_type in spec.description.input:
          self.assertEqual(
              input_type.type.WhichOneof("Type"), "doubleType"
          )
      self.assertEqual(
          sorted(self.scikit_data.feature_names),
          sorted(map(lambda x: x.name, spec.description.input)),
      )
  
      # Test the linear regression parameters.
      tr = spec.treeEnsembleClassifier.treeEnsemble
      self.assertIsNotNone(tr)
  
imports: import json
  import tempfile
  import unittest
  from coremltools._deps import _HAS_SKLEARN, _HAS_XGBOOST
  from coremltools.converters import sklearn
  from coremltools.models.utils import _macos_version
label_desc: Use image node_id 3 for calling the GradientBoostingMulticlassClassifierXGboostTest obj's underlying member method code with example usage: obj.test_conversion_from_file() without return types