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

    https://github.com/apache/spark/pull/16158#discussion_r91957172
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/tuning/TrainValidationSplit.scala ---
    @@ -123,7 +124,10 @@ class TrainValidationSplit @Since("1.5.0") 
(@Since("1.5.0") override val uid: St
         logInfo(s"Best set of parameters:\n${epm(bestIndex)}")
         logInfo(s"Best train validation split metric: $bestMetric.")
         val bestModel = est.fit(dataset, epm(bestIndex)).asInstanceOf[Model[_]]
    -    copyValues(new TrainValidationSplitModel(uid, bestModel, 
metrics).setParent(this))
    +    val model = copyValues(new TrainValidationSplitModel(uid, bestModel, 
metrics).setParent(this))
    +    val summary = new TuningSummary(bestModel.transform(dataset), epm, 
metrics, bestIndex)
    --- End diff --
    
    It seems wasteful to do `bestModel.transform(dataset)` just to get access 
to the `sqlContext`. Is it really necessary?


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