code: def _toSparkGLM(self, model):
          
          skl_cls = type(model)
          py_cls = self._skl2spark_classes[skl_cls].py
          jvm_cls_name = self._skl2spark_classes[skl_cls].jvm
          intercept = model.intercept_
          weights = model.coef_
          if len(np.shape(weights)) == 1\
                  or (len(np.shape(weights)) == 2 and np.shape(weights)[0] == 1):
              # Binary classification
              uid = _randomUID(skl_cls)
              _java_model = _new_java_obj(self.sc, jvm_cls_name, uid, Vectors.dense(weights), float(intercept))
              return py_cls(_java_model)
          elif len(np.shape(weights)) == 2 and skl_cls == SKL_LogisticRegression:
              # Multiclass label
              raise ValueError("Converter.toSpark cannot convert a multiclass sklearn Logistic" +
                               " Regression model to Spark because Spark does not yet support" +
                               " multiclass.  Given model is for %d classes." %
                               np.shape(weights)[0])
          else:
              raise Exception("Converter.toSpark experienced unknown error when trying to convert" +
                              " a model of type: " + type(model) + "  " + len(np.shape(weights)))
docs: Private method for converting a GLM to a Spark model
          TODO: Add model parameters as well.