Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/19208#discussion_r148375136
--- Diff:
mllib/src/main/scala/org/apache/spark/ml/tuning/CrossValidator.scala ---
@@ -236,12 +252,17 @@ object CrossValidator extends
MLReadable[CrossValidator] {
class CrossValidatorModel private[ml] (
@Since("1.4.0") override val uid: String,
@Since("1.2.0") val bestModel: Model[_],
- @Since("1.5.0") val avgMetrics: Array[Double])
+ @Since("1.5.0") val avgMetrics: Array[Double],
+ @Since("2.3.0") val subModels: Option[Array[Array[Model[_]]]])
--- End diff --
This API (Option) won't be Java-friendly. I'd prefer to follow this
pattern, which has been used for optional fields such as model summaries:
* private val which is an Option
* public method ```subModels: Array[Array[Model[_]]]``` which throws an
Exception if the sub-models are not available
* public method ```hasSubModels: Boolean``` for checking if subModels is
available
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]