code: def convert_sklearn_linear_regression_model(
      operator, device, extra_config
  ):
      """
      Converter for `sklearn.linear_model.LinearRegression`, `sklearn.linear_model.Lasso`, `sklearn.linear_model.ElasticNet`, `sklearn.linear_model.Ridge`, `sklearn.svm.LinearSVR` and `sklearn.linear_model.RidgeCV`
  
      Args:
          operator: An operator wrapping a `sklearn.linear_model.LinearRegression`, `sklearn.svm.LinearSVR`
              or `sklearn.linear_model.RidgeCV` model
          device: String defining the type of device the converted operator should be run on
          extra_config: Extra configuration used to select the best conversion strategy
  
      Returns:
          A PyTorch model
      """
      assert operator is not None, "Cannot convert None operator"
  
      loss = None
      coefficients = operator.raw_operator.coef_.transpose().astype(
          "float32"
      )
      if len(coefficients.shape) == 1:
          coefficients = coefficients.reshape(-1, 1)
  
      intercepts = operator.raw_operator.intercept_
      if np.ndim(intercepts) == 0:
          intercepts = np.array(intercepts, dtype="float32")
      else:
          intercepts = intercepts.reshape(1, -1).astype("float32")
  
      if hasattr(operator.raw_operator, "_base_loss") and isinstance(
          operator.raw_operator._base_loss.link, LogLink
      ):
          loss = "log"
  
      return LinearModel(
          operator,
          coefficients,
          intercepts,
          device,
          loss=loss,
          is_linear_regression=True,
      )
  
imports: import numpy
  from onnxconverter_common.registration import register_converter
  from sklearn._loss.link import LogLink
  from .._linear_implementations import LinearModel
label_desc: Use image node_id 2 for calling a global function with example usage: convert_sklearn_linear_regression_model(operator, device, extra_config) and returns: LinearModel