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

    https://github.com/apache/spark/pull/14112#discussion_r70335191
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/clustering/LDA.scala ---
    @@ -574,18 +578,28 @@ object LocalLDAModel extends 
MLReadable[LocalLDAModel] {
           val metadata = DefaultParamsReader.loadMetadata(path, sc, className)
           val dataPath = new Path(path, "data").toString
           val data = sparkSession.read.parquet(dataPath)
    -        .select("vocabSize", "topicsMatrix", "docConcentration", 
"topicConcentration",
    -          "gammaShape")
    -        .head()
    -      val vocabSize = data.getAs[Int](0)
    -      val topicsMatrix = data.getAs[Matrix](1)
    -      val docConcentration = data.getAs[Vector](2)
    -      val topicConcentration = data.getAs[Double](3)
    -      val gammaShape = data.getAs[Double](4)
    +      val vectorConverted = MLUtils.convertVectorColumnsToML(data, 
"docConcentration")
    +      val Row(vocabSize: Int, topicsMatrix: Matrix, docConcentration: 
Vector,
    +      topicConcentration: Double, gammaShape: Double) = 
MLUtils.convertMatrixColumnsToML(
    --- End diff --
    
    style: indent 4 spaces
    
    You could also simplify this with Datasets by using 
```(DataFrame).as[Data]``` if you make ```LocalLDAModelWriter.Data``` 
accessible here (by moving it to sit under ```object LocalLDAModel```).


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