aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorYanbo Liang <ybliang8@gmail.com>2016-04-11 14:01:05 -0700
committerJoseph K. Bradley <joseph@databricks.com>2016-04-11 14:01:05 -0700
commit3f0f40800bda98026f8a5e45c0a4ae2600c2d693 (patch)
treeb1ccbb498ef9109007e197600fada3ebf3ca6c10 /mllib
parent89a41c5b7a3f727b44a7f615a1352ca006d12f73 (diff)
downloadspark-3f0f40800bda98026f8a5e45c0a4ae2600c2d693.tar.gz
spark-3f0f40800bda98026f8a5e45c0a4ae2600c2d693.tar.bz2
spark-3f0f40800bda98026f8a5e45c0a4ae2600c2d693.zip
[SPARK-14298][ML][MLLIB] Add unit test for EM LDA disable checkpointing
## What changes were proposed in this pull request? This is follow up for #12089, add unit test for EM LDA which test disable checkpointing when set ```checkpointInterval = -1```. ## How was this patch tested? unit test. cc jkbradley Author: Yanbo Liang <ybliang8@gmail.com> Closes #12286 from yanboliang/spark-14298-followup.
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/test/scala/org/apache/spark/ml/clustering/LDASuite.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/ml/clustering/LDASuite.scala b/mllib/src/test/scala/org/apache/spark/ml/clustering/LDASuite.scala
index ee8eae8f69..17d6e9fc2e 100644
--- a/mllib/src/test/scala/org/apache/spark/ml/clustering/LDASuite.scala
+++ b/mllib/src/test/scala/org/apache/spark/ml/clustering/LDASuite.scala
@@ -289,4 +289,15 @@ class LDASuite extends SparkFunSuite with MLlibTestSparkContext with DefaultRead
assert(model.getCheckpointFiles.isEmpty)
}
+
+ test("EM LDA disable checkpointing") {
+ // Checkpoint dir is set by MLlibTestSparkContext
+ val lda = new LDA().setK(2).setSeed(1).setOptimizer("em").setMaxIter(3)
+ .setCheckpointInterval(-1)
+ val model_ = lda.fit(dataset)
+ assert(model_.isInstanceOf[DistributedLDAModel])
+ val model = model_.asInstanceOf[DistributedLDAModel]
+
+ assert(model.getCheckpointFiles.isEmpty)
+ }
}