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

    https://github.com/apache/spark/pull/11119#discussion_r79947128
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/util/DefaultReadWriteTest.scala ---
    @@ -107,24 +133,34 @@ trait DefaultReadWriteTest extends TempDirectory { 
self: Suite =>
         }
         val model = estimator.fit(dataset)
     
    -    // Test Estimator save/load
    -    val estimator2 = testDefaultReadWrite(estimator)
    -    testParams.foreach { case (p, v) =>
    -      val param = estimator.getParam(p)
    -      assert(estimator.get(param).get === estimator2.get(param).get)
    +    val testFunctions = if (testParams.contains("initialModel")) {
    +      Map(("initialModel", checkModelData.asInstanceOf[(Any, Any) => 
Unit]))
    +    } else {
    +      Map.empty[String, (Any, Any) => Unit]
         }
     
    +    // Test Estimator save/load
    +    val estimator2 = testDefaultReadWrite(estimator, testParams = false)
    +    compareParamsWithComplexTypes(estimator, estimator2, testParams, 
testFunctions)
    +
         // Test Model save/load
    -    val model2 = testDefaultReadWrite(model)
    -    testParams.foreach { case (p, v) =>
    -      val param = model.getParam(p)
    -      assert(model.get(param).get === model2.get(param).get)
    -    }
    +    val model2 = testDefaultReadWrite(model, testParams = false)
    +    compareParamsWithComplexTypes(model, model2, testParams, testFunctions)
     
         checkModelData(model, model2)
       }
     }
     
    +class MyModel extends Model[MyModel] {
    --- End diff --
    
    This is never used.


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