Github user yanboliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16464#discussion_r95948100
  
    --- Diff: R/pkg/R/mllib_clustering.R ---
    @@ -404,11 +411,14 @@ setMethod("summary", signature(object = "LDAModel"),
                 vocabSize <- callJMethod(jobj, "vocabSize")
                 topics <- dataFrame(callJMethod(jobj, "topics", 
maxTermsPerTopic))
                 vocabulary <- callJMethod(jobj, "vocabulary")
    +            trainingLogLikelihood <- callJMethod(jobj, 
"trainingLogLikelihood")
    +            logPrior <- callJMethod(jobj, "logPrior")
    --- End diff --
    
    I think it's more appropriate to return ```NULL``` rather than ```NaN``` 
for local LDA model, since the ```logPrior``` is not existing rather than not a 
number.
    BTW, I think we can return NULL directly according to ```isDistributed```, 
otherwise, call corresponding Scala methods. This should reduce the complexity 
of ```LDAWrapper``` and reduce communication between R and Scala.


---
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]

Reply via email to