spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkbradley <...@git.apache.org>
Subject [GitHub] spark pull request #21081: [SPARK-23975][ML]Allow Clustering to take Arrays ...
Date Tue, 17 Apr 2018 20:43:20 GMT
Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21081#discussion_r182215639
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala ---
    @@ -123,7 +128,21 @@ class KMeansModel private[ml] (
       @Since("2.0.0")
       override def transform(dataset: Dataset[_]): DataFrame = {
         transformSchema(dataset.schema, logging = true)
    -    val predictUDF = udf((vector: Vector) => predict(vector))
    +    // val predictUDF = udf((vector: Vector) => predict(vector))
    +    val predictUDF = if (dataset.schema($(featuresCol)).dataType.equals(new VectorUDT))
{
    +      udf((vector: Vector) => predict(vector))
    +    }
    +    else {
    +      udf((vector: Seq[_]) => {
    --- End diff --
    
    scala style: remove unnecessary ```{``` at end of line (IntelliJ should warn you about
this)


---

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


Mime
View raw message