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

    https://github.com/apache/spark/pull/15450#discussion_r84720821
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/clustering/KMeansSuite.scala ---
    @@ -85,9 +101,50 @@ class KMeansSuite extends SparkFunSuite with 
MLlibTestSparkContext {
             Vectors.dense(1.0, 3.0, 4.0)),
           2)
     
    -    // Make sure code runs.
    -    var model = KMeans.train(data, k = 3, maxIterations = 1)
    -    assert(model.clusterCenters.size === 3)
    +    var model = KMeans.train(data, k = 3, maxIterations = 1, 
initializationMode = "random")
    +    assert(model.clusterCenters.length === 2)
    +
    +    model = KMeans.train(data, k = 3, maxIterations = 1, 
initializationMode = "k-means||")
    +    assert(model.clusterCenters.length === 2)
    +  }
    +
    +  test("unique cluster centers") {
    +    val rng = new scala.util.Random(42)
    --- End diff --
    
    make `seed` a val and use it instead of literal 42.


---
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