class_docstr: Unit test class for testing scikit-learn converter.
class_docstr_tok: ["Unit","test","class","for","testing","scikit-learn","converter","."]
code: def test_conversion(self):
      input_names = self.scikit_data.feature_names
      spec = convert(
          self.scikit_model, input_names, "target"
      ).get_spec()
      self.assertIsNotNone(spec)
  
      # Test the model class
      self.assertIsNotNone(spec.description)
  
      # Test the interface class
      self.assertEqual(spec.description.predictedFeatureName, "target")
  
      # Test the inputs and outputs
      self.assertEqual(len(spec.description.output), 1)
      self.assertEqual(spec.description.output[0].name, "target")
      self.assertEqual(
          spec.description.output[0].type.WhichOneof("Type"),
          "doubleType",
      )
      for input_type in spec.description.input:
          self.assertEqual(
              input_type.type.WhichOneof("Type"), "doubleType"
          )
      self.assertEqual(
          sorted(input_names),
          sorted(map(lambda x: x.name, spec.description.input)),
      )
  
      # Test the linear regression parameters.
      self.assertTrue(
          spec.pipelineRegressor.pipeline.models[-1].HasField(
              "glmRegressor"
          )
      )
      lr = spec.pipelineRegressor.pipeline.models[-1].glmRegressor
      self.assertEqual(lr.offset, self.scikit_model.intercept_)
      self.assertEqual(len(lr.weights), 1)
      self.assertEqual(len(lr.weights[0].value), 13)
      i = 0
      for w in lr.weights[0].value:
          self.assertAlmostEqual(w, self.scikit_model.coef_[i])
          i = i + 1
  
file_path: coremltools/coremltools/test/sklearn_tests/test_linear_regression.py
imports: import unittest
  import pandas
  from coremltools._deps import _HAS_SKLEARN
  from coremltools.models.utils import _is_macos, _macos_version, evaluate_regressor
label_desc: Use image node_id 2 for calling the LinearRegressionScikitTest obj's underlying member method code with example usage: obj.test_conversion() without return types