Hadop集群服务器.docVIP

  • 17
  • 0
  • 约1.38万字
  • 约 9页
  • 2017-02-05 发布于湖北
  • 举报
5. count = 0, Sring[] partialSums; 7. while (values.hasNext()) do 8. partialSums = values.next().toString().split(); 9. for (int i = 0; i partialSums.length - 1; i++) do 10. point.array[i] += Double.parseDouble(partialSums[i]); 11. end for 12. count += Integer.parseInt(partialSums[partialSums.length - 1]); 13. end while 14. /*计算距离相似度平均值,并找出新的聚类中心*/ 15. for (int i = 0; i point.arr.length; i++) do 16. point.array[i] /= count; 17. end for 18. until convergence; //新聚类中心值与上次迭代的聚类中心值绝对值小于程序中预设值的阈值 19. end 20. Emit output.collect(null, Text(outStr))

文档评论(0)

1亿VIP精品文档

相关文档