mahout kmeans 例子
2015-12-01 12:41
459 查看
一、mahout 简单例子测试
mahout 安装配置可以参考:mahout安装配置
1、kmeans 聚类算法测试数据来源:
地址:http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data
2、下载数据,把数据存放到hdfs上(hadoop2.6.1 已经启动)
创建测试目录testdata,并把数据导入到这个tastdata目录中(这里的目录的名字只能是testdata)
[/code]
3、执行kmeans算法,等待运行结果
[/code]
4、运行成功查看运行结果
[/code]
显示如下结果证明运行成功:
[/code]
mahout 安装配置可以参考:mahout安装配置
1、kmeans 聚类算法测试数据来源:
地址:http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data
2、下载数据,把数据存放到hdfs上(hadoop2.6.1 已经启动)
创建测试目录testdata,并把数据导入到这个tastdata目录中(这里的目录的名字只能是testdata)
$ hdfs dfs -mkdir testdata
$ hdfs dfs -put /home/lin/hadoop/mahout-distribution-0.10.0/test.data testdata
[/code]
3、执行kmeans算法,等待运行结果
$ hadoop jar /home/lin/hadoop/mahout-distribution-0.10.0/mahout-examples-0.10.0-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
[/code]
4、运行成功查看运行结果
hdfs dfs -ls output
[/code]
显示如下结果证明运行成功:
lin@lin162:~/hadoop/hadoop-2.6.1/etc/hadoop$ hdfs dfs -ls output
Found 15 items
-rw-r--r-- 2 lin supergroup 194 2015-12-01 12:27 output/_policy
drwxr-xr-x - lin supergroup 0 2015-12-01 12:27 output/clusteredPoints
drwxr-xr-x - lin supergroup 0 2015-12-01 12:22 output/clusters-0
drwxr-xr-x - lin supergroup 0 2015-12-01 12:23 output/clusters-1
drwxr-xr-x - lin supergroup 0 2015-12-01 12:27 output/clusters-10-final
drwxr-xr-x - lin supergroup 0 2015-12-01 12:23 output/clusters-2
drwxr-xr-x - lin supergroup 0 2015-12-01 12:24 output/clusters-3
drwxr-xr-x - lin supergroup 0 2015-12-01 12:24 output/clusters-4
drwxr-xr-x - lin supergroup 0 2015-12-01 12:25 output/clusters-5
drwxr-xr-x - lin supergroup 0 2015-12-01 12:25 output/clusters-6
drwxr-xr-x - lin supergroup 0 2015-12-01 12:25 output/clusters-7
drwxr-xr-x - lin supergroup 0 2015-12-01 12:26 output/clusters-8
drwxr-xr-x - lin supergroup 0 2015-12-01 12:26 output/clusters-9
drwxr-xr-x - lin supergroup 0 2015-12-01 12:22 output/data
drwxr-xr-x - lin supergroup 0 2015-12-01 12:22 output/random-seeds
[/code]
相关文章推荐
- jQuery Validate扩展验证方法
- OpenCV + Eclipse CDT + MinGW超爽使用体验以及常见问题合辑
- poj 1236 Network of Schools(强连通分量 Tarjan算法)
- POJ 3628 Bookshelf 2
- 20135310陈巧然 20135305姚歌 实验四:外设驱动程序设计
- yum 安装软件时报Public key for * is not installed
- JS中的bind方法
- mahout 安装配置
- unity3D Text 使用shader
- 20135310陈巧然 20135305姚歌 实验一:开发环境的熟悉
- js的浮点数加法
- 数据库有数据,但查询不到数据,没查到还爆空指针
- 【linux】 Linux cp 实现强行覆盖
- Android Context小总结
- “数学口袋精灵”第二个Sprint计划(第六~八天)
- 智能语音人机交互产业链及关键技术分析
- 几种检查更新并下载新版本的实现
- 给你的Linux装一个"D盘"
- Android:在子线程中更新UI,解析异步消息处理机制(Handler)
- 20135305姚歌 20135310陈巧然 实验五:通讯协议设计