mahout安装配置

mahout安装很简单,在官网上下载,复制到服务器上。

解压:

tar -xzvf /opt/mahout-distribution-0.9.tar.gz

将安装位置添加到环境变量

vi /etc/profile

export $MAHOUT_HOME=/opt/mahout-distribution-0.9

export PATH=$MAHOUT_HOME/conf:$MAHOUT_HOME/bin:$PATH

source /etc/profile

输入命令mahout,可以看到mahout实现的所有命令,安装成功。


用mahout运行自带的示例程序:

首先在网页

http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data下载示例数据synthetic_control.data。

在hdfs上创建目录/user/root/testdata。(注意一定要在该位置!)

若hdfs上没有,上级目录,也可以递归创建

hadoop fs -mkdir -p /user/root/testdata

hadoop fs -put synthetic_control.data /user/root/testdata

hadoop jar $MAHOUT_HOME/mahout-examples-0.9-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job

程序会自动运行,并将结果写至/user/root/output文件夹中,

hadoop fs -ls /user/root/output

可以看到程序执行后的聚类。



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值