Repository: spark
Updated Branches:
  refs/heads/master fdc2aa491 -> c4f0b4f33


SPARK-5020 [MLlib] GaussianMixtureModel.predictMembership() should take an RDD 
only

Removed unnecessary parameters to predictMembership()

CC: jkbradley

Author: Travis Galoppo <[email protected]>

Closes #3854 from tgaloppo/spark-5020 and squashes the following commits:

1bf4669 [Travis Galoppo] renamed predictMembership() to predictSoft()
0f1d96e [Travis Galoppo] SPARK-5020 - Removed superfluous parameters from 
predictMembership()


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c4f0b4f3
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c4f0b4f3
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c4f0b4f3

Branch: refs/heads/master
Commit: c4f0b4f334f7f3565375921fcac184ad5b1fb207
Parents: fdc2aa4
Author: Travis Galoppo <[email protected]>
Authored: Wed Dec 31 15:39:58 2014 -0800
Committer: Xiangrui Meng <[email protected]>
Committed: Wed Dec 31 15:39:58 2014 -0800

----------------------------------------------------------------------
 .../spark/mllib/clustering/GaussianMixtureModel.scala       | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c4f0b4f3/mllib/src/main/scala/org/apache/spark/mllib/clustering/GaussianMixtureModel.scala
----------------------------------------------------------------------
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 11a110d..b461ea4 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
@@ -45,7 +45,7 @@ class GaussianMixtureModel(
 
   /** Maps given points to their cluster indices. */
   def predict(points: RDD[Vector]): RDD[Int] = {
-    val responsibilityMatrix = predictMembership(points, mu, sigma, weight, k)
+    val responsibilityMatrix = predictSoft(points)
     responsibilityMatrix.map(r => r.indexOf(r.max))
   }
   
@@ -53,12 +53,7 @@ class GaussianMixtureModel(
    * Given the input vectors, return the membership value of each vector
    * to all mixture components. 
    */
-  def predictMembership(
-      points: RDD[Vector], 
-      mu: Array[Vector], 
-      sigma: Array[Matrix],
-      weight: Array[Double], 
-      k: Int): RDD[Array[Double]] = {
+  def predictSoft(points: RDD[Vector]): RDD[Array[Double]] = {
     val sc = points.sparkContext
     val dists = sc.broadcast {
       (0 until k).map { i => 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to