aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorZheng RuiFeng <ruifengz@foxmail.com>2016-10-28 00:40:06 -0700
committerYanbo Liang <ybliang8@gmail.com>2016-10-28 00:40:06 -0700
commit569788a55e4c6b218fb697e1e54c6138ffe657a6 (patch)
treed9b27848c128dbad16f256b50bd0c40717f489d5 /mllib
parentab5f938bc7c3c9b137d63e479fced2b7e9c9d75b (diff)
downloadspark-569788a55e4c6b218fb697e1e54c6138ffe657a6.tar.gz
spark-569788a55e4c6b218fb697e1e54c6138ffe657a6.tar.bz2
spark-569788a55e4c6b218fb697e1e54c6138ffe657a6.zip
[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 <ruifengz@foxmail.com> Closes #15636 from zhengruifeng/gmm_instr.
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/org/apache/spark/ml/clustering/GaussianMixture.scala6
1 files changed, 6 insertions, 0 deletions
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 e3cb92f4f1..8fac63fefb 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")