code: def _convert(model, features, target):
      # Set the model class (regressor)
      spec = _Model_pb2.Model()
      spec.specificationVersion = SPECIFICATION_VERSION
      spec = set_regressor_interface_params(spec, features, target)
  
      # Add parameters for the linear regression.
      lr = spec.glmRegressor
  
      if isinstance(model.intercept_, _np.ndarray):
          assert len(model.intercept_) == 1
          lr.offset.append(model.intercept_[0])
      else:
          lr.offset.append(model.intercept_)
  
      weights = lr.weights.add()
      for i in model.coef_:
          weights.value.append(i)
      return spec
  
file_path: turicreate/src/external/coremltools_wrap/coremltools/coremltools/converters/sklearn/_linear_regression.py
imports: from ...None import SPECIFICATION_VERSION
  from ...models._interface_management import set_regressor_interface_params
  from ...proto import Model_pb2
  from ...proto import FeatureTypes_pb2
  import numpy
  from ..._deps import _HAS_SKLEARN
  from ...models import MLModel
label_desc: Use image node_id 2 for calling a global function with example usage: _convert(model, features, target) and returns: spec