Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/6000#discussion_r29976495
--- Diff:
examples/src/main/scala/org/apache/spark/examples/mllib/LDAExample.scala ---
@@ -137,14 +151,18 @@ object LDAExample {
sc.setCheckpointDir(params.checkpointDir.get)
}
val startTime = System.nanoTime()
- val ldaModel = lda.run(corpus).asInstanceOf[DistributedLDAModel]
+ val ldaModel = lda.run(corpus)
val elapsed = (System.nanoTime() - startTime) / 1e9
println(s"Finished training LDA model. Summary:")
println(s"\t Training time: $elapsed sec")
- val avgLogLikelihood = ldaModel.logLikelihood /
actualCorpusSize.toDouble
- println(s"\t Training data average log likelihood: $avgLogLikelihood")
- println()
+
+ if(ldaModel.isInstanceOf[DistributedLDAModel]) {
--- End diff --
scala style: space after "if"
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]