Github user FlytxtRnD commented on a diff in the pull request:
https://github.com/apache/spark/pull/4059#discussion_r23754619
--- Diff: python/pyspark/mllib/tests.py ---
@@ -167,6 +167,32 @@ def test_kmeans_deterministic(self):
# TODO: Allow small numeric difference.
self.assertTrue(array_equal(c1, c2))
+ def test_gmm(self):
+ from pyspark.mllib.clustering import GaussianMixtureEM
+ data = self.sc.parallelize([
+ [1, 2],
+ [8, 9],
+ [-4, -3],
+ [-6, -7],
+ ])
+ clusters = GaussianMixtureEM.train(data, 2, convergenceTol=0.001,
+ seed=56, maxIterations=100)
+ labels = clusters.predict(data).collect()
+ self.assertEquals(labels[0], labels[1])
+ self.assertEquals(labels[2], labels[3])
+
+ def test_gmm_deterministic(self):
+ from pyspark.mllib.clustering import GaussianMixtureEM
+ X = range(0, 100, 10)
--- End diff --
@mengxr Will fix the suggestions soon.
---
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]