srowen commented on a change in pull request #17864: [SPARK-20604][ML] Allow 
imputer to handle numeric types
URL: https://github.com/apache/spark/pull/17864#discussion_r309388413
 
 

 ##########
 File path: mllib/src/test/scala/org/apache/spark/ml/feature/ImputerSuite.scala
 ##########
 @@ -176,6 +178,51 @@ class ImputerSuite extends MLTest with 
DefaultReadWriteTest {
     assert(newInstance.surrogateDF.collect() === 
instance.surrogateDF.collect())
   }
 
+  test("Imputer for Numeric with default missing Value NaN") {
+    val df = spark.createDataFrame(Seq(
+      (0, 1.0, 1.0, 1.0),
+      (1, 11.0, 11.0, 11.0),
+      (2, 3.6, 3.6, 3.6),
+      (3, Double.NaN, 5.2, 3.6)
 
 Review comment:
   It's not necessarily true that the mean of the values after casting is equal 
to the mean after casting, but here it happens to be. That's OK I think. What 
about checking the case where a non-NaN value is set as the missing value?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to