You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by yl...@apache.org on 2016/10/28 07:40:12 UTC

spark git commit: [SPARK-18109][ML] Add instrumentation to GMM

Repository: spark
Updated Branches:
  refs/heads/master ab5f938bc -> 569788a55


[SPARK-18109][ML] Add instrumentation to GMM

## What changes were proposed in this pull request?

Add instrumentation to GMM

## How was this patch tested?

Test in spark-shell

Author: Zheng RuiFeng <ru...@foxmail.com>

Closes #15636 from zhengruifeng/gmm_instr.


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

Branch: refs/heads/master
Commit: 569788a55e4c6b218fb697e1e54c6138ffe657a6
Parents: ab5f938
Author: Zheng RuiFeng <ru...@foxmail.com>
Authored: Fri Oct 28 00:40:06 2016 -0700
Committer: Yanbo Liang <yb...@gmail.com>
Committed: Fri Oct 28 00:40:06 2016 -0700

----------------------------------------------------------------------
 .../scala/org/apache/spark/ml/clustering/GaussianMixture.scala | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/569788a5/mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala
----------------------------------------------------------------------
diff --git a/mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala b/mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala
index e3cb92f..8fac63f 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala
@@ -323,6 +323,9 @@ class GaussianMixture @Since("2.0.0") (
       case Row(point: Vector) => OldVectors.fromML(point)
     }
 
+    val instr = Instrumentation.create(this, rdd)
+    instr.logParams(featuresCol, predictionCol, probabilityCol, k, maxIter, seed, tol)
+
     val algo = new MLlibGM()
       .setK($(k))
       .setMaxIterations($(maxIter))
@@ -337,6 +340,9 @@ class GaussianMixture @Since("2.0.0") (
     val summary = new GaussianMixtureSummary(model.transform(dataset),
       $(predictionCol), $(probabilityCol), $(featuresCol), $(k))
     model.setSummary(summary)
+    instr.logNumFeatures(model.gaussians.head.mean.size)
+    instr.logSuccess(model)
+    model
   }
 
   @Since("2.0.0")


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org