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

    https://github.com/apache/spark/pull/22764#discussion_r226812121
  
    --- 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 --
    
    @mgaido91 
    What about this way ?
    In `ml` reader, we can load `trainingCost` and then construct 
`mllib.clustering.BisectingKMeansModel` and pass the `trainingCost` argument 
and then construct `ml.clustering.BisectingKMeansModel` to wrap that `mllib` 
model.
    ** Then in `ml` reader we can check the spark major/minor version to keep 
backwards compatibility, this is a more important thing. **
    ** In `mllib` loader we can ignore loading `trainingCost`, because `mllib` 
is deprecate, we can ignore adding new features, but we cannot breaking 
backwards compatibility (your change breaking backwards compatibility). **


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to