首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > k-means算法在单机上的MapReduce实现

k-means算法在单机上的MapReduce实现

  • 资源大小:22.96 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: k-means,MapReduce

资 源 简 介

k-means算法在单机上的MapReduce实现 public ArrayList> getrandomCenters(String filepath) throws NumberFormatException, IOException { BufferedReader reader = new BufferedReader(new FileReader(filepath)); int mk = KmeansDriver.getMk(); int i = 0; String line = ""; ArrayList tmpDataList = new ArrayList (); ArrayList> randomCenterList = new ArrayList>(); while ((line = reader.readLine()) != null && tmpDataList.size() < mk*20) { if (line.trim().length() == 0) { continue; } i++; String[] dataList = line.split(","); for(String data : dataList){ tmpDataList.add(data); }

文 件 列 表

src
com
output
part-00000
bin
com
1.txt
VIP VIP
0.181401s