diff options
author | wm624@hotmail.com <wm624@hotmail.com> | 2017-01-12 18:31:57 -0800 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2017-01-12 18:31:57 -0800 |
commit | c983267b0853f908d1c671cedd18b159e6993df1 (patch) | |
tree | 229005a41ff770562b47a2155ba0c5579c54f3ea /mllib/src | |
parent | 5585ed93b09bc05cdd7a731650eca50d43d7159b (diff) | |
download | spark-c983267b0853f908d1c671cedd18b159e6993df1.tar.gz spark-c983267b0853f908d1c671cedd18b159e6993df1.tar.bz2 spark-c983267b0853f908d1c671cedd18b159e6993df1.zip |
[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.
Diffstat (limited to 'mllib/src')
-rw-r--r-- | mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala b/mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala index 211e2bc026..086bb211a9 100644 --- a/mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala +++ b/mllib/src/test/scala/org/apache/spark/mllib/clustering/LDASuite.scala @@ -505,6 +505,8 @@ class LDASuite extends SparkFunSuite with MLlibTestSparkContext { assert(distributedModel.topicConcentration === sameDistributedModel.topicConcentration) assert(distributedModel.gammaShape === sameDistributedModel.gammaShape) assert(distributedModel.globalTopicTotals === sameDistributedModel.globalTopicTotals) + assert(distributedModel.logLikelihood ~== sameDistributedModel.logLikelihood absTol 1e-6) + assert(distributedModel.logPrior ~== sameDistributedModel.logPrior absTol 1e-6) val graph = distributedModel.graph val sameGraph = sameDistributedModel.graph |