Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/22764#discussion_r226688846
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/clustering/BisectingKMeansModel.scala
---
@@ -225,13 +227,14 @@ object BisectingKMeansModel extends
Loader[BisectingKMeansModel] {
assert(formatVersion == thisFormatVersion)
val rootId = (metadata \ "rootId").extract[Int]
val distanceMeasure = (metadata \ "distanceMeasure").extract[String]
+ val trainingCost = (metadata \ "trainingCost").extract[Double]
--- End diff --
> this model can read from previous versions, since this is version "2.0",
which was introduced for Spark 2.4; for previous versions, we read/write
version "1.0"; the version check method for versioning is used only for the ml
package, not in mllib where we have this versioning approach;
I meant that can it read old model from previous versions, not that this
model can read from previous versions.
In other words, when reading a previous model without "trainingCost" in
metadata, can this line work well?
```scala
val trainingCost = (metadata \ "trainingCost").extract[Double]
```
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]