You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/07/12 03:24:05 UTC

[GitHub] [spark] zhengruifeng commented on a change in pull request #24793: [SPARK-27944][ML] Unify the behavior of checking empty output column names

zhengruifeng commented on a change in pull request #24793: [SPARK-27944][ML] Unify the behavior of checking empty output column names
URL: https://github.com/apache/spark/pull/24793#discussion_r302814838
 
 

 ##########
 File path: mllib/src/main/scala/org/apache/spark/ml/clustering/BisectingKMeans.scala
 ##########
 @@ -107,9 +107,15 @@ class BisectingKMeansModel private[ml] (
   @Since("2.0.0")
   override def transform(dataset: Dataset[_]): DataFrame = {
     transformSchema(dataset.schema, logging = true)
-    val predictUDF = udf((vector: Vector) => predict(vector))
-    dataset.withColumn($(predictionCol),
-      predictUDF(DatasetUtils.columnToVector(dataset, getFeaturesCol)))
+    if ($(predictionCol).nonEmpty) {
 
 Review comment:
   I changed here to keep in line with other algs like  [LDA.transform](https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/clustering/LDA.scala#L461)
   Or leave alone algs with only one output column, and remove the check in algs like LDA?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org