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

    https://github.com/apache/spark/pull/15314#discussion_r86460724
  
    --- Diff: 
mllib/src/test/scala/org/apache/spark/ml/util/MLTestingUtils.scala ---
    @@ -47,18 +48,49 @@ object MLTestingUtils extends SparkFunSuite {
         } else {
           genRegressionDFWithNumericLabelCol(spark)
         }
    -    val expected = estimator.fit(dfs(DoubleType))
    -    val actuals = dfs.keys.filter(_ != DoubleType).map(t => 
estimator.fit(dfs(t)))
    +
    +    val expected = estimator match {
    --- End diff --
    
    Simplify this: 
    
    ````scala
    val expected = estimator match {
          case weighted: Estimator[M] with HasWeightCol =>
            weighted.set(weighted.weightCol, "weight")
            weighted.fit(dfs(DoubleType))
          case _ => estimator.fit(dfs(DoubleType))
        }
    ````
    
    Same thing below


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