Skip to content

Commit c983267

Browse files
wangmiao1981jkbradley
authored andcommitted
[SPARK-19110][MLLIB][FOLLOWUP] Add a unit test for testing logPrior and logLikelihood of DistributedLDAModel in MLLIB
## What changes were proposed in this pull request? #16491 added the fix to mllib and a unit test to ml. This followup PR, add unit tests to mllib suite. ## How was this patch tested? Unit tests. Author: wm624@hotmail.com <wm624@hotmail.com> Closes #16524 from wangmiao1981/ldabug.
1 parent 5585ed9 commit c983267

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,8 @@ class LDASuite extends SparkFunSuite with MLlibTestSparkContext {
505505
assert(distributedModel.topicConcentration === sameDistributedModel.topicConcentration)
506506
assert(distributedModel.gammaShape === sameDistributedModel.gammaShape)
507507
assert(distributedModel.globalTopicTotals === sameDistributedModel.globalTopicTotals)
508+
assert(distributedModel.logLikelihood ~== sameDistributedModel.logLikelihood absTol 1e-6)
509+
assert(distributedModel.logPrior ~== sameDistributedModel.logPrior absTol 1e-6)
508510

509511
val graph = distributedModel.graph
510512
val sameGraph = sameDistributedModel.graph

0 commit comments

Comments
 (0)