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

    https://github.com/apache/spark/pull/4459#discussion_r24326687
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/mllib/clustering/GaussianMixtureSuite.scala
 ---
    @@ -40,10 +41,15 @@ class GaussianMixtureSuite extends FunSuite with 
MLlibTestSparkContext {
         val seeds = Array(314589, 29032897, 50181, 494821, 4660)
         seeds.foreach { seed =>
           val gmm = new GaussianMixture().setK(1).setSeed(seed).run(data)
    +      val sparseGMM = new 
GaussianMixture().setK(1).setSeed(seed).run(sparseData)
           assert(gmm.weights(0) ~== Ew absTol 1E-5)
           assert(gmm.gaussians(0).mu ~== Emu absTol 1E-5)
           assert(gmm.gaussians(0).sigma ~== Esigma absTol 1E-5)
    +      assert(sparseGMM.weights(0) ~== Ew absTol 1E-5)
    +      assert(sparseGMM.gaussians(0).mu ~== Emu absTol 1E-5)
    +      assert(sparseGMM.gaussians(0).sigma ~== Esigma absTol 1E-5)
    --- End diff --
    
    You could use the same data; I just think it would be good to have separate 
tests, to help narrow down where the issue is if one of them fails.  But if you 
want to create new data, there's not much to it: for the single cluster case, 
any data will do, you just need to compute the mean and variance; for the two 
cluster case, you will also want to provide a starting model which can 
guarantee the proper convergence (or find a seed that works for the 
initialization process).


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