Research Article
Meteorological Data Analysis Using MapReduce
// Reduce(key, points) | Input: key is the index of the cluster centers, points is the list of the partial sums | from different centers. | Output: , where key′ is the index of the closet center point, | Value′ is the new center. | (1) Num = 0; | (2) While (points.hasNext()){ | currentPoint = points.next(); | Num+ = currentPoint.getnum; | For (; <dimensions; ++){ | sum[]+ = currentPoint.point[]; | (3) } | (4) For (; <dimentsions; ++) | mean[] = sum[]/Num; | (5) output pair; | (6) End |
|