Skip to content

Commit

Permalink
Add unit test for EM LDA disable checkpointing
Browse files Browse the repository at this point in the history
  • Loading branch information
yanboliang committed Apr 10, 2016
1 parent 22014e6 commit acf7455
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mllib/src/test/scala/org/apache/spark/ml/clustering/LDASuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -289,4 +289,14 @@ 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)
}
}

0 comments on commit acf7455

Please sign in to comment.