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

    https://github.com/apache/spark/pull/18610#discussion_r126911229
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/util/DefaultReadWriteTest.scala ---
    @@ -113,7 +115,14 @@ trait DefaultReadWriteTest extends TempDirectory { 
self: Suite =>
         val estimator2 = testDefaultReadWrite(estimator)
         testEstimatorParams.foreach { case (p, v) =>
           val param = estimator.getParam(p)
    -      assert(estimator.get(param).get === estimator2.get(param).get)
    +      if (param.name == "initialModel") {
    +        // Estimator's `initialModel` has same type as the model produced 
by this estimator.
    --- End diff --
    
    This is an assumption that ```initialModel``` must be the same type of the 
model that the estimator produced. We should enforce this assumption by making 
the trait as ```HasInitialModel[T <: Model[T]]``` or add new argument 
```checkInitialModelData``` for ```testEstimatorAndModelReadWrite```. I'm open 
to hear others' thoughts and update here after collecting feedback. Thanks.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to