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

    https://github.com/apache/spark/pull/6948#discussion_r34728825
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala ---
    @@ -354,4 +444,139 @@ class DistributedLDAModel private (
       // TODO:
       // override def topicDistributions(documents: RDD[(Long, Vector)]): 
RDD[(Long, Vector)] = ???
     
    +  override protected def formatVersion = "1.0"
    +
    +  override def save(sc: SparkContext, path: String): Unit = {
    +    DistributedLDAModel.SaveLoadV1_0.save(
    +      sc, path, graph, globalTopicTotals, k, vocabSize, docConcentration, 
topicConcentration,
    +      iterationTimes)
    +  }
    +}
    +
    +
    +@Experimental
    +object DistributedLDAModel extends Loader[DistributedLDAModel]{
    +
    +
    +  object SaveLoadV1_0 {
    +
    +    val thisFormatVersion = "1.0"
    +
    +    val classNameV1_0 = 
"org.apache.spark.mllib.clustering.DistributedLDAModel"
    +
    +    // Store the weight of each topic separately in a row.
    +    case class Data(globalTopicTotals: Double)
    --- End diff --
    
    Sorry, this had not quite registered in my head.  Since this is stored as a 
Vector already, let's just keep it as a Vector and store it in 1 row.  That 
should be simpler and make sure we don't have to worry about the ordering of 
rows in the DataFrame when loading data back.


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