Skip to content

Commit d0d8cf4

Browse files
author
Feynman Liang
committed
Fix thisClassName
1 parent 0f30109 commit d0d8cf4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mllib/src/main/scala/org/apache/spark/mllib/clustering/LDAModel.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ object LocalLDAModel extends Loader[LocalLDAModel] {
307307

308308
val thisFormatVersion = "1.0"
309309

310-
val classNameV1_0 = "org.apache.spark.mllib.clustering.LocalLDAModel"
310+
val thisClassName = "org.apache.spark.mllib.clustering.LocalLDAModel"
311311

312312
// Store the distribution of terms of each topic and the column index in topicsMatrix
313313
// as a Row in data.
@@ -325,7 +325,7 @@ object LocalLDAModel extends Loader[LocalLDAModel] {
325325

326326
val k = topicsMatrix.numCols
327327
val metadata = compact(render
328-
(("class" -> classNameV1_0) ~ ("version" -> thisFormatVersion) ~
328+
(("class" -> thisClassName) ~ ("version" -> thisFormatVersion) ~
329329
("k" -> k) ~ ("vocabSize" -> topicsMatrix.numRows) ~
330330
("docConcentration" -> docConcentration.toArray.toSeq) ~
331331
("topicConcentration" -> topicConcentration) ~
@@ -374,7 +374,7 @@ object LocalLDAModel extends Loader[LocalLDAModel] {
374374
Vectors.dense((metadata \ "docConcentration").extract[Seq[Double]].toArray)
375375
val topicConcentration = (metadata \ "topicConcentration").extract[Double]
376376
val gammaShape = (metadata \ "gammaShape").extract[Double]
377-
val classNameV1_0 = SaveLoadV1_0.classNameV1_0
377+
val classNameV1_0 = SaveLoadV1_0.thisClassName
378378

379379
val model = (loadedClassName, loadedVersion) match {
380380
case (className, "1.0") if className == classNameV1_0 =>
@@ -581,7 +581,7 @@ object DistributedLDAModel extends Loader[DistributedLDAModel] {
581581

582582
val thisFormatVersion = "1.0"
583583

584-
val classNameV1_0 = "org.apache.spark.mllib.clustering.DistributedLDAModel"
584+
val thisClassName = "org.apache.spark.mllib.clustering.DistributedLDAModel"
585585

586586
// Store globalTopicTotals as a Vector.
587587
case class Data(globalTopicTotals: Vector)
@@ -607,7 +607,7 @@ object DistributedLDAModel extends Loader[DistributedLDAModel] {
607607
import sqlContext.implicits._
608608

609609
val metadata = compact(render
610-
(("class" -> classNameV1_0) ~ ("version" -> thisFormatVersion) ~
610+
(("class" -> thisClassName) ~ ("version" -> thisFormatVersion) ~
611611
("k" -> k) ~ ("vocabSize" -> vocabSize) ~
612612
("docConcentration" -> docConcentration.toArray.toSeq) ~
613613
("topicConcentration" -> topicConcentration) ~
@@ -676,7 +676,7 @@ object DistributedLDAModel extends Loader[DistributedLDAModel] {
676676
val topicConcentration = (metadata \ "topicConcentration").extract[Double]
677677
val iterationTimes = (metadata \ "iterationTimes").extract[Seq[Double]]
678678
val gammaShape = (metadata \ "gammaShape").extract[Double]
679-
val classNameV1_0 = SaveLoadV1_0.classNameV1_0
679+
val classNameV1_0 = SaveLoadV1_0.thisClassName
680680

681681
val model = (loadedClassName, loadedVersion) match {
682682
case (className, "1.0") if className == classNameV1_0 => {

0 commit comments

Comments
 (0)