Research Article
Meteorological Data Analysis Using MapReduce
// map(key, value) | Input: , Global variable centers, the offset key, the sample value | Output: , where key′ is the index of the closet center point near the value′. | (1) Construct a global variable centers, then assign the center point to centers. | (2) minDistance = MAX_VALUE; | (3) For (; <= centers.length; ++) | { | If (distance(point, centers[]) < minDistance) | minDistance = distance(point, centers[]); | index = | (4) } | (5) Key′ = nearestCluster | (6) Output (key′, value′) | (7) End |
|