gengliangwang commented on code in PR #46151:
URL: https://github.com/apache/spark/pull/46151#discussion_r1575315002
##########
mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala:
##########
@@ -192,12 +193,13 @@ class CrossValidator @Since("1.2.0") (@Since("1.4.0")
override val uid: String)
foldMetrics
}.transpose.map(_.sum / $(numFolds)) // Calculate average metric over all
splits
- instr.logInfo(s"Average cross-validation metrics:
${metrics.toImmutableArraySeq}")
+ instr.logInfo(log"Average cross-validation metrics: ${MDC(
+ CROSS_VALIDATION_METRICS, metrics.mkString("[", ", ", "]"))}")
val (bestMetric, bestIndex) =
if (eval.isLargerBetter) metrics.zipWithIndex.maxBy(_._1)
else metrics.zipWithIndex.minBy(_._1)
- instr.logInfo(s"Best set of parameters:\n${epm(bestIndex)}")
- instr.logInfo(s"Best cross-validation metric: $bestMetric.")
+ instr.logInfo(log"Best set of parameters:\n${MDC(ESTIMATOR_PARAMETER_MAP,
epm(bestIndex))}")
Review Comment:
There is no good solution for this now. We can convert and migrate
everything to the new framework and revisit this later.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]