Thanks, for the guidance.
For finding out E(X^2), I used the following map/reduce functions
map = function(k,v) { keyval(1,(as.numeric(v))^2)}
reduce = function(k,v) {keyval(length(v),sum(v)/length(v))}
For finding ( E(X) )^2, I used the following map/reduce
map1 = function(k,v) { keyval(1,as.numeric(v))}
reduce1 = function(k,v) {keyval(length(v),(sum(v)/length(v))^2)}
In both the instances, since map function emits only one key of value 1, the
load will be only on one reducer. Only one reducer will be summing up all numbers.
Am I right? If so, I think this process is not efficient as multiple reducers are not being used.
Thanks,
On Thursday, October 24, 2013 2:40:44 PM UTC+5:30, Ashok Kumar Harnal wrote: