K-Means算法 mapreduce
代码说明:
public class KmeansMapper extends MapReduceBase implements Mapper { // one coodinate(data) private List coordinate = new ArrayList(); private BasicKMeansTool basicKmeans = new BasicKMeansTool(); public void map(LongWritable key, Text value, OutputCollector midoutput, Reporter arg3) throws IOException { // TODO Auto-generated method stub String line = value.toString(); String[] dataList = line.split(","); List distances = null; StringTokenizer itr; for (int i = 0; i < dataList.length; i++) { itr = new StringTokenizer(dataList[i]); &nbs
下载说明:请别用迅雷下载,失败请重下,重下不扣分!