def toSKLearn(self, model):
if isinstance(model, LogisticRegressionModel):<EOL><INDENT>return self._toSKLGLM(model, True)<EOL><DEDENT>if isinstance(model, LinearRegressionModel):<EOL><INDENT>return self._toSKLGLM(model, False)<EOL><DEDENT>else:<EOL><INDENT>supported_types = map(lambda t: type(t), self._supported_spark_types)<EOL>raise ValueError("<STR_LIT>" %<EOL>(type(model), "<STR_LIT:U+002CU+0020>".join(supported_types)))<EOL><DEDENT>
Convert a Spark MLlib model from the Pipelines API (spark.ml) to a scikit-learn model.
Currently supported models:
- pyspark.ml.classification.LogisticRegressionModel
- pyspark.ml.regression.LinearRegressionModel

:param model: Spark ML model
:return: scikit-learn model with equivalent predictive behavior.
         Currently, parameters or arguments for training are not copied.