You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the RDD.fold requires operator to be communicative, which was violated by asymmetry in the map() function, the result might be different for different number of partitions in RDD.
The text was updated successfully, but these errors were encountered:
I think you're right; this should really be aggregate? that is it needs to handle adding together the current sum of squares, and the square of a new value, differently from summing partial sums of squares?
val sumSquares = dataAsArray.aggregate(
new Array[Double](numCols)
)(
(a, b) => a.zip(b).map(t => t._1 + t._2 * t._2),
(a, b) => a.zip(b).map(t => t._1 + t._2)
)
On page 92 in calculating
sumSquares
, the codeAs the
RDD.fold
requires operator to be communicative, which was violated by asymmetry in the map() function, the result might be different for different number of partitions in RDD.The text was updated successfully, but these errors were encountered: