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

    https://github.com/apache/spark/pull/11119#discussion_r77047770
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala ---
    @@ -446,6 +463,20 @@ private[ml] object DefaultParamsReader {
         val cls = Utils.classForName(metadata.className)
         cls.getMethod("read").invoke(null).asInstanceOf[MLReader[T]].load(path)
       }
    +
    +  def loadInitialModel[M <: Model[M]](instance: Params, path: String, sc: 
SparkContext): Unit = {
    --- End diff --
    
    Why are we checking the spark version here?
    
    We can be more specific in the types:
    
    ````scala
      def loadInitialModel[M <: Model[M]](
          instance: HasInitialModel[M],
          path: String,
          sc: SparkContext): Unit = {
        implicit val format = DefaultFormats
        val metadata = DefaultParamsReader.loadMetadata(path, sc)
    
        val hasInitialModel = (metadata.metadata \ 
"initialModel").extract[Boolean]
        if (hasInitialModel) {
          val initialModelPath = new Path(path, "initialModel").toString
          val loadedInitialModel = loadParamsInstance[M](initialModelPath, sc)
          instance.set(instance.initialModel, loadedInitialModel)
        }
    }
    ````


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