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

    https://github.com/apache/spark/pull/16158#discussion_r131454343
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala ---
    @@ -133,7 +134,10 @@ class CrossValidator @Since("1.2.0") (@Since("1.4.0") 
override val uid: String)
         logInfo(s"Best cross-validation metric: $bestMetric.")
         val bestModel = est.fit(dataset, epm(bestIndex)).asInstanceOf[Model[_]]
         instr.logSuccess(bestModel)
    -    copyValues(new CrossValidatorModel(uid, bestModel, 
metrics).setParent(this))
    +    val model = new CrossValidatorModel(uid, bestModel, 
metrics).setParent(this)
    +    val summary = new TuningSummary(epm, metrics, bestIndex)
    +    model.setSummary(Some(summary))
    --- End diff --
    
    There might be something like detailed training log and training time for 
each model. But I'm thinking the current Summary pattern does have some room 
for improvement (e.g., save/load and API), it makes me feel bad when I have to 
duplicate the code like 
    `def hasSummary: Boolean = trainingSummary.nonEmpty`. Thus saving it to the 
models sounds like a good idea to me. 


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