matlab聚类kmeans代码-hadoop-hw7:hadoop-hw7

上传者: 38718434 | 上传时间: 2022-12-07 18:05:50 | 文件大小: 1.23MB | 文件类型: ZIP
matlab聚类kmeans代码 作业7 要求 在MapReduce上实现K-Means算法并在小数据集上测试。可以使用附件的数据集,也可以随机生成若干散点的二维数据(x, y)。设置不同的K值和迭代次数,可视化聚类结果。 提交要求同作业5,附上可视化截图。 实现思路 我直接使用了实例代码来运行,用原来的代码创建maven项目KMeansExample。由于原来的代码不是用maven管理的,而且是基于Hadoop1.2编写的程序,所以有一些地方需要进行小小的修改。比如每个java文件前面都要加上对应的包名称,Job对象的创建需要调用getInstance静态方法,而不能直接new Job。 我尝试研读了整个算法的代码,下面简要描述一下示例代码的思路。 主程序:KMeansDriver.main() KMeansDriver.main()方法是整个算法的主程序,它从命令行接收指定的参数k(需要聚成的类数),iterationNum(迭代次数),inputpath,outputpath。依次调用三个主要的过程: generateInitialCluster():随机产生k个cluster

文件下载

资源详情

[{"title":"( 57 个子文件 1.23MB ) matlab聚类kmeans代码-hadoop-hw7:hadoop-hw7","children":[{"title":"hadoop-hw7-master","children":[{"title":".gitignore <span style='color:#111;'> 477B </span>","children":null,"spread":false},{"title":"README.md <span style='color:#111;'> 6.30KB </span>","children":null,"spread":false},{"title":"pom.xml <span style='color:#111;'> 2.58KB </span>","children":null,"spread":false},{"title":"target","children":[{"title":"KMeansExample-1.0-SNAPSHOT.jar <span style='color:#111;'> 23.38KB </span>","children":null,"spread":false}],"spread":true},{"title":"pics","children":[{"title":"res2","children":[{"title":"5-4.jpg <span style='color:#111;'> 17.74KB </span>","children":null,"spread":false},{"title":"2-3.jpg <span style='color:#111;'> 17.19KB </span>","children":null,"spread":false},{"title":"5-3.jpg <span style='color:#111;'> 17.88KB </span>","children":null,"spread":false},{"title":"4-4.jpg <span style='color:#111;'> 17.54KB </span>","children":null,"spread":false},{"title":"4-3.jpg <span style='color:#111;'> 17.71KB </span>","children":null,"spread":false},{"title":"4-5.jpg <span style='color:#111;'> 17.61KB </span>","children":null,"spread":false},{"title":"all.png <span style='color:#111;'> 162.98KB </span>","children":null,"spread":false},{"title":"3-4.jpg <span style='color:#111;'> 17.56KB </span>","children":null,"spread":false},{"title":"2-5.jpg <span style='color:#111;'> 17.48KB </span>","children":null,"spread":false},{"title":"3-5.jpg <span style='color:#111;'> 17.83KB </span>","children":null,"spread":false},{"title":"files.png <span style='color:#111;'> 38.02KB </span>","children":null,"spread":false},{"title":"5-5.jpg <span style='color:#111;'> 17.84KB </span>","children":null,"spread":false},{"title":"2-4.jpg <span style='color:#111;'> 17.36KB </span>","children":null,"spread":false},{"title":"3-3.jpg <span style='color:#111;'> 17.61KB </span>","children":null,"spread":false}],"spread":false},{"title":"res1","children":[{"title":"km1-1.png <span style='color:#111;'> 91.02KB </span>","children":null,"spread":false},{"title":"km1-5.png <span style='color:#111;'> 10.86KB </span>","children":null,"spread":false},{"title":"km1-2.png <span style='color:#111;'> 63.08KB </span>","children":null,"spread":false},{"title":"km1-4.png <span style='color:#111;'> 42.23KB </span>","children":null,"spread":false},{"title":"km1-3.png <span style='color:#111;'> 68.23KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"src","children":[{"title":"main","children":[{"title":"java","children":[{"title":"com","children":[{"title":"hw7","children":[{"title":"KMeansDriver.java <span style='color:#111;'> 3.71KB </span>","children":null,"spread":false},{"title":"KMeansCluster.java <span style='color:#111;'> 2.96KB </span>","children":null,"spread":false},{"title":"Cluster.java <span style='color:#111;'> 1.91KB </span>","children":null,"spread":false},{"title":"Instance.java <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"RandomClusterGenerator.java <span style='color:#111;'> 3.68KB </span>","children":null,"spread":false},{"title":"king","children":[{"title":"Utils","children":[{"title":"ListWritable.java <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"HammingDistance.java <span style='color:#111;'> 453B </span>","children":null,"spread":false},{"title":"Distance.java <span style='color:#111;'> 145B </span>","children":null,"spread":false},{"title":"InstanceGenerator.java <span style='color:#111;'> 851B </span>","children":null,"spread":false},{"title":"EuclideanDistance.java <span style='color:#111;'> 512B </span>","children":null,"spread":false}],"spread":false}],"spread":false},{"title":"KMeans.java <span style='color:#111;'> 4.51KB </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true}],"spread":true}],"spread":true},{"title":"output","children":[{"title":"result2","children":[{"title":"5-4.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"5-5.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"3-4.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"3-3.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"2-4.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"3-5.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"4-3.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"4-4.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"4-5.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"2-3.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"2-5.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"5-3.csv <span style='color:#111;'> 784B </span>","children":null,"spread":false}],"spread":false},{"title":"result1","children":[{"title":"cluster-2","children":[{"title":"part-r-00000 <span style='color:#111;'> 84B </span>","children":null,"spread":false},{"title":"_SUCCESS <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"cluster-0","children":[{"title":"clusters <span style='color:#111;'> 42B </span>","children":null,"spread":false}],"spread":true},{"title":"cluster-1","children":[{"title":"part-r-00000 <span style='color:#111;'> 122B </span>","children":null,"spread":false},{"title":"_SUCCESS <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"cluster-3","children":[{"title":"part-r-00000 <span style='color:#111;'> 70B </span>","children":null,"spread":false},{"title":"_SUCCESS <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"clusteredInstances","children":[{"title":"part-m-00000 <span style='color:#111;'> 784B </span>","children":null,"spread":false},{"title":"_SUCCESS <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"README.pdf <span style='color:#111;'> 663.73KB </span>","children":null,"spread":false},{"title":"generate_res.sh <span style='color:#111;'> 643B </span>","children":null,"spread":false}],"spread":true}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明