zhengruifeng commented on a change in pull request #25812: 
[SPARK-22796][PYTHON][ML] Add multiple columns support to PySpark 
QuantileDiscretizer
URL: https://github.com/apache/spark/pull/25812#discussion_r325544161
 
 

 ##########
 File path: python/pyspark/ml/feature.py
 ##########
 @@ -2082,10 +2144,19 @@ def _create_model(self, java_model):
         """
         Private method to convert the java_model to a Python model.
         """
-        return Bucketizer(splits=list(java_model.getSplits()),
-                          inputCol=self.getInputCol(),
-                          outputCol=self.getOutputCol(),
-                          handleInvalid=self.getHandleInvalid())
+        if (self.isSet(self.inputCol)):
+            return Bucketizer(splits=list(java_model.getSplits()),
+                              inputCol=self.getInputCol(),
+                              outputCol=self.getOutputCol(),
+                              handleInvalid=self.getHandleInvalid())
+        else:
+            splitsArrayList = []
+            for x in list(java_model.getSplitsArray()):
+                splitsArrayList.append(list(x))
 
 Review comment:
   what about `splitsArrayList = [list(x) for x in 
list(java_model.getSplitsArray())]`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to