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

    https://github.com/apache/spark/pull/12577#discussion_r60696894
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/evaluation/RegressionEvaluator.scala 
---
    @@ -86,8 +106,9 @@ final class RegressionEvaluator @Since("1.4.0") 
(@Since("1.4.0") override val ui
     
         val predictionAndLabels = dataset
           .select(col($(predictionCol)).cast(DoubleType), 
col($(labelCol)).cast(DoubleType))
    -      .rdd.
    -      map { case Row(prediction: Double, label: Double) =>
    +      .na.drop("any", if ($(dropNaN)) Seq($(predictionCol)) else Seq())
    --- End diff --
    
    Good point, will add `null` to test cases. I don't think it's likely in 
practice. But actually if nulls do exist in the dataset, it's worse than NaN 
from a correctness point of view, as either a NPE will be thrown, or it will be 
treated as 0 => 0 squared error for that datapoint, but the denominator will 
still be added for the mean calculation. So MSE will be biased low.


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