From 1de73f399a28060890c8617f1abddad46b30c132 Mon Sep 17 00:00:00 2001 From: Travis Galoppo Date: Thu, 18 Dec 2014 16:45:28 -0500 Subject: [PATCH] Removed redundant array from array creation --- .../apache/spark/mllib/clustering/GaussianMixtureModel.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala b/mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala index a38381e505258..c02aa60dd86ca 100644 --- a/mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala +++ b/mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala @@ -65,7 +65,7 @@ class GaussianMixtureModel( new MultivariateGaussian(mu(i).toBreeze.toDenseVector, sigma(i).toBreeze.toDenseMatrix) }.toArray } - val weights = sc.broadcast((0 until k).map(i => weight(i)).toArray) + val weights = sc.broadcast(weight) points.map{ x => computeSoftAssignments(x.toBreeze.toDenseVector, dists.value, weights.value, k) }