Github user MLnick commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12609#discussion_r60874354
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/clustering/KMeansSuite.scala ---
    @@ -117,6 +126,24 @@ class KMeansSuite extends SparkFunSuite with 
MLlibTestSparkContext with DefaultR
         assert(clusterSizes.forall(_ >= 0))
       }
     
    +  test("transform with modified model's parameters") {
    +    val newFeaturesColumnName = "kmeans_model_features"
    --- End diff --
    
    I think it's enough to consolidate your two tests into one:
    
    ```scala
    val featuresColName = "new_features"
    val predictionColName = "new_prediction"
    val model = new KMeans().setK(k).setSeed(1).fit(dataset)
    model.setFeaturesCol(featuresColName).setPredictionCol(predictionColName)
    val transformed = model.transform(dataset.withColumnRenamed("features", 
featuresColName))
    Seq(featuresColName, predictionColName).foreach { col =>
      assert(transformed.columns.contains(column))
    }
    assert(model.getFeaturesCol === featuresColName)
    assert(model.getPredictionCol === predictionColName)
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to