You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Xiangrui Meng (JIRA)" <ji...@apache.org> on 2015/11/13 17:25:11 UTC

[jira] [Comment Edited] (SPARK-11720) Return Double.NaN instead of null for Mean and Average when count = 0

    [ https://issues.apache.org/jira/browse/SPARK-11720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15004206#comment-15004206 ] 

Xiangrui Meng edited comment on SPARK-11720 at 11/13/15 4:25 PM:
-----------------------------------------------------------------

Computing average in the normal way should be sufficient. The precision issue is different from moment aggregation. Using m' = m + 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.


was (Author: mengxr):
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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org