[ https://issues.apache.org/jira/browse/SPARK-11720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15004206#comment-15004206 ]
Xiangrui Meng commented on SPARK-11720: --------------------------------------- Computing average in the normal way should be sufficient. The precision issue is different from moment aggregation. Using m_{k+1} = m_{k} + delta/n won't help. We need https://en.wikipedia.org/wiki/Kahan_summation_algorithm or an equivalent algorithm to be very accurate, but it seems unnecessary in Spark. > Return Double.NaN instead of null for Mean and Average when count = 0 > --------------------------------------------------------------------- > > Key: SPARK-11720 > URL: https://issues.apache.org/jira/browse/SPARK-11720 > Project: Spark > Issue Type: Sub-task > Reporter: Jihong MA > > change the default behavior of mean in case of count = 0 from null to > Double.NaN, to make it inline with all other univariate stats function. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org For additional commands, e-mail: issues-h...@spark.apache.org