code: def toSpark(self, model):
          
          if isinstance(model, SKL_LogisticRegression) or isinstance(model, SKL_LinearRegression):
              return self._toSparkGLM(model)
          else:
              supported_types = map(lambda t: type(t), self._supported_skl_types)
              raise ValueError("Converter.toSpark cannot convert type: %s.  Supported types: %s" %
                               (type(model), ", ".join(supported_types)))
docs: Convert a scikit-learn model to a Spark ML model from the Pipelines API (spark.ml).
          Currently supported models:
          - sklearn.linear_model.LogisticRegression (binary classification only, not multiclass)
          - sklearn.linear_model.LinearRegression
  
          :param model: scikit-learn model
          :return: Spark ML model with equivalent predictive behavior.
                   Currently, parameters or arguments for training are not copied.