Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/15413#discussion_r95031946 --- Diff: mllib/src/test/scala/org/apache/spark/ml/clustering/GaussianMixtureSuite.scala --- @@ -126,9 +143,104 @@ class GaussianMixtureSuite extends SparkFunSuite with MLlibTestSparkContext testEstimatorAndModelReadWrite(gm, dataset, GaussianMixtureSuite.allParamSettings, checkModelData) } + + test("univariate dense data with two clusters") { + val weights = Array(2.0 / 3.0, 1.0 / 3.0) + val means = Array(Vectors.dense(5.1604), Vectors.dense(-4.3673)) + val covs = Array(Matrices.dense(1, 1, Array(0.86644)), Matrices.dense(1, 1, Array(1.1098))) + val gaussians = means.zip(covs).map { case (mean, cov) => + new MultivariateGaussian(mean, cov) + } + + val expected = new GaussianMixtureModel("dummy", weights, gaussians) + val actual = new GaussianMixture().setK(2).setSeed(seed).fit(denseDataset) + modelEquals(expected, actual) + } + + test("univariate sparse data with two clusters") { --- End diff -- Actually, don't bother. This looks ready.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org