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

    https://github.com/apache/spark/pull/12230#discussion_r59049645
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/classification/GBTClassifier.scala ---
    @@ -257,12 +240,61 @@ final class GBTClassificationModel private[ml](
       private[ml] def toOld: OldGBTModel = {
         new OldGBTModel(OldAlgo.Classification, _trees.map(_.toOld), 
_treeWeights)
       }
    +
    +  @Since("2.0.0")
    +  override def write: MLWriter = new 
GBTClassificationModel.GBTClassificationModelWriter(this)
     }
     
    -private[ml] object GBTClassificationModel {
    +@Since("2.0.0")
    +object GBTClassificationModel extends MLReadable[GBTClassificationModel] {
    +
    +  @Since("2.0.0")
    +  override def read: MLReader[GBTClassificationModel] = new 
GBTClassificationModelReader
    +
    +  @Since("2.0.0")
    +  override def load(path: String): GBTClassificationModel = 
super.load(path)
    +
    +  private[GBTClassificationModel]
    +  class GBTClassificationModelWriter(instance: GBTClassificationModel) 
extends MLWriter {
    +
    +    override protected def saveImpl(path: String): Unit = {
    +      val extraMetadata: JObject = Map(
    +        "numFeatures" -> instance.numFeatures,
    +        "numTrees" -> instance.getNumTrees)
    --- End diff --
    
    Actually, GBT does not need ```numClasses```.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to