mahout安装配置
1.下载mahout
下载地址:http://mahout.apache.org
我下载的最新版:mahout-distribution-0.9
2.把mahout解压到你想存放的文档,我是放在/Users/jia/Documents/hadoop-0.20.2,即hadoop的安装目录上。
3.为mahout配置环境
打开终端,打开profile文件所在的目录
JIAS-MacBook-Pro:~ jia$ open /etc
把profile文件复制到桌面,然后编辑,在它后面加入环境变量
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/Home export HADOOP_HOME=Documents/hadoop-0.20.2 export MAHOUT_HOME=Documents/hadoop-0.20.2/mahout-distribution-0.9 export MAVEN_HOME=Documents/apache-maven-3.2.2export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$MAVEN_HOME/bin:$MAHOUT_HOME/binexport HADOOP_CONF_DIR=Documents/hadoop-0.20.2/conf export MAHOUT_CONF_DIR=Documents/hadoop-0.20.2/mahout-distribution-0.9/confexport classpath=$classpath:$JAVA_HOME/lib:$MAHOUT_HOME/lib:$HADOOP_CONF_DIR:$MAHOUT_CONF_DIR
然后把桌面上的profile文件覆盖/etc上的profile,期间要输入管理员密码
注意:
1.如果在ubuntu下安装的是hadoop2.6进行配置的话,路径为:
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 export HADOOP_HOME=/home/sendi/hadoop-2.6.0 export MAHOUT_HOME=/home/sendi/mahout-distribution-0.9 export MAVEN_HOME=/home/sendi/apache-maven-3.3.3export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$MAVEN_HOME/bin:$MAHOUT_HOME/binexport HADOOP_CONF_DIR=/home/sendi/hadoop-2.6.0/etc/hadoop export MAHOUT_CONF_DIR=/home/sendi/mahout-distribution-0.9/confexport classpath=$classpath:$JAVA_HOME/lib:$MAHOUT_HOME/lib:$HADOOP_CONF_DIR:$MAHOUT_CONF_DIR
View Code
2.配置MAHOU_CONF_DIR时有些网站说时export MAHOUT_CONF_DIR=Documents/hadoop-0.20.2/mahout-distribution-0.9/src/conf
0.9版本的正确配置是:export MAHOUT_CONF_DIR=Documents/hadoop-0.20.2/mahout-distribution-0.9/conf ,因为当你打开mahout文件夹时,发现没有src这个目录 mahout官网上0.9版本有几个压缩文件,我自己试过,前面两个小压缩文件不行。
这里我选择的是第5个78M的。
4.检验mahout是否配置成功
4.1启动hadoop
JIAS-MacBook-Pro:hadoop-0.20.2 jia$ bin/start-all.sh
4.2查看mahout
JIAS-MacBook-Pro:mahout-distribution-0.9 jia$ bin/mahout MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath. hadoop binary is not in PATH,HADOOP_HOME/bin,HADOOP_PREFIX/bin, running locally An example program must be given as the first argument. Valid program names are:arff.vector: : Generate Vectors from an ARFF file or directorybaumwelch: : Baum-Welch algorithm for unsupervised HMM trainingcanopy: : Canopy clusteringcat: : Print a file or resource as the logistic regression models would see itcleansvd: : Cleanup and verification of SVD outputclusterdump: : Dump cluster output to textclusterpp: : Groups Clustering Output In Clusterscmdump: : Dump confusion matrix in HTML or text formatsconcatmatrices: : Concatenates 2 matrices of same cardinality into a single matrixcvb: : LDA via Collapsed Variation Bayes (0th deriv. approx)cvb0_local: : LDA via Collapsed Variation Bayes, in memory locally.evaluateFactorization: : compute RMSE and MAE of a rating matrix factorization against probesfkmeans: : Fuzzy K-means clusteringhmmpredict: : Generate random sequence of observations by given HMMitemsimilarity: : Compute the item-item-similarities for item-based collaborative filteringkmeans: : K-means clusteringlucene.vector: : Generate Vectors from a Lucene indexlucene2seq: : Generate Text SequenceFiles from a Lucene indexmatrixdump: : Dump matrix in CSV formatmatrixmult: : Take the product of two matricesparallelALS: : ALS-WR factorization of a rating matrixqualcluster: : Runs clustering experiments and summarizes results in a CSVrecommendfactorized: : Compute recommendations using the factorization of a rating matrixrecommenditembased: : Compute recommendations using item-based collaborative filteringregexconverter: : Convert text files on a per line basis based on regular expressionsresplit: : Splits a set of SequenceFiles into a number of equal splitsrowid: : Map SequenceFile<Text,VectorWritable> to {SequenceFile<IntWritable,VectorWritable>, SequenceFile<IntWritable,Text>}rowsimilarity: : Compute the pairwise similarities of the rows of a matrixrunAdaptiveLogistic: : Score new production data using a probably trained and validated AdaptivelogisticRegression modelrunlogistic: : Run a logistic regression model against CSV dataseq2encoded: : Encoded Sparse Vector generation from Text sequence filesseq2sparse: : Sparse Vector generation from Text sequence filesseqdirectory: : Generate sequence files (of Text) from a directoryseqdumper: : Generic Sequence File dumperseqmailarchives: : Creates SequenceFile from a directory containing gzipped mail archivesseqwiki: : Wikipedia xml dump to sequence filespectralkmeans: : Spectral k-means clusteringsplit: : Split Input data into test and train setssplitDataset: : split a rating dataset into training and probe partsssvd: : Stochastic SVDstreamingkmeans: : Streaming k-means clusteringsvd: : Lanczos Singular Value Decompositiontestnb: : Test the Vector-based Bayes classifiertrainAdaptiveLogistic: : Train an AdaptivelogisticRegression modeltrainlogistic: : Train a logistic regression using stochastic gradient descenttrainnb: : Train the Vector-based Bayes classifiertranspose: : Take the transpose of a matrixvalidateAdaptiveLogistic: : Validate an AdaptivelogisticRegression model against hold-out data setvecdist: : Compute the distances between a set of Vectors (or Cluster or Canopy, they must fit in memory) and a list of Vectorsvectordump: : Dump vectors from a sequence file to textviterbi: : Viterbi decoding of hidden states from given output states sequence
这里需要说明下,当你看到下面的代码时,以为是错的,其实不是,原因:
MAHOUT_LOCAL:设置是否本地运行,如果设置这个参数就不会运行hadoop了,一旦设置这个参数,那HADOOP_CONF_DIR 和HADOOP_HOME 这两个参数的
设置就自动失效了。
当初我就在这个问题上纠结了很久。
MAHOUT_LOCAL is not set; adding HADOOP_CONF_DIR to classpath. hadoop binary is not in PATH,HADOOP_HOME/bin,HADOOP_PREFIX/bin, running locally
5.运行mahout的算法
5.1到下面的地址去下载测试数据
http://archive.ics.uci.edu/ml/databases/synthetic_control/synthetic_control.data
5.2创建测试目录testdata,并把数据导入到这个testdata目录中
JIAS-MacBook-Pro:hadoop-0.20.2 jia$ bin/hadoop fs -mkdir testdata
5.3把测试数据上传到hdfs上,不能把测试数据存在mac上用pages建立的文档上,而是建立一个新的文件命令:touch data
JIAS-MacBook-Pro:hadoop-0.20.2 jia$ bin/hadoop fs -put workspace/data testdata/
5.4运行mahout上的kmeans算法
JIAS-MacBook-Pro:hadoop-0.20.2 jia$ bin/hadoop jar mahout-distribution-0.9/mahout-examples-0.9-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
5.5查看结果
JIAS-MacBook-Pro:~ jia$ cd Documents/hadoop-0.20.2/ JIAS-MacBook-Pro:hadoop-0.20.2 jia$ bin/hadoop fs -ls output/ Found 15 items -rwxrwxrwx 1 jia staff 194 2014-08-03 14:42 /Users/jia/Documents/hadoop-0.20.2/output/_policy drwxr-xr-x - jia staff 136 2014-08-03 14:42 /Users/jia/Documents/hadoop-0.20.2/output/clusteredPoints drwxr-xr-x - jia staff 544 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-0 drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-1 drwxr-xr-x - jia staff 204 2014-08-03 14:42 /Users/jia/Documents/hadoop-0.20.2/output/clusters-10-final drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-2 drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-3 drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-4 drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-5 drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-6 drwxr-xr-x - jia staff 204 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/clusters-7 drwxr-xr-x - jia staff 204 2014-08-03 14:42 /Users/jia/Documents/hadoop-0.20.2/output/clusters-8 drwxr-xr-x - jia staff 204 2014-08-03 14:42 /Users/jia/Documents/hadoop-0.20.2/output/clusters-9 drwxr-xr-x - jia staff 136 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/data drwxr-xr-x - jia staff 136 2014-08-03 14:41 /Users/jia/Documents/hadoop-0.20.2/output/random-seeds
转载于:https://www.cnblogs.com/aijianiula/p/3888386.html
mahout安装配置相关推荐
- mysql64如何配置_win7 64位下如何安装配置mysql-winx64(安装记录)
win7 64位下如何安装配置mysql winx64 1.mysql下载 官方网站下载地址:http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5. ...
- ActiveMQ—安装配置及使用
安装配置及使用 转自:http://blog.csdn.net/qq_21033663/article/details/52461543 (一)ActiveMQ介绍 ActiveMQ 是Apache出 ...
- Linux下Tomcat的安装配置
Linux下Tomcat的安装配置 一.下载安装对应的jdk,并配置Java环境. 官网下载地址: http://www.oracle.com/technetwork/java/javase/down ...
- wamp的mysql单独使用_Windows 7+8.1+10 单独安装配置 PHP+Apache+MySQL(不使用 WAMP)
Windows 8.1 单独安装配置 PHP+Apache+MySQL(不使用 WAMP) 本文同样适用于Windows7和10 0x00 PHP [下载]http://www.doczj.com/d ...
- mysql数据库解压安装教程_MySQL数据库之windows 10下解压版MySql安装配置方法教程...
本文主要向大家介绍了MySQL数据库之windows 10下解压版MySql安装配置方法教程 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助. windows 10 下安装解压版的 ...
- python3.6.2怎样安装,python 3.6.2 安装配置方法图文教程
python 3.6.2 安装配置方法图文教程 Windows下Python(pip)环境搭建(3.6)图解,供大家参考,具体内容如下 1.下载最新的Python安装:3.6.2 2.安装时不要选择默 ...
- centos7 mysql workbench_centOS下mysql workbench安装配置教程
本文为大家分享了mysql workbench安装配置教程,供大家参考,具体内容如下 step0:安装mysql 在按照workbench之前,先安装mysql.指令是 yum install mys ...
- Centos5.6 VNC安装配置【无错版】
不严格按本步骤就会出现VNC桌面花屏,就是桌面分离为一层一层的... ---------------------------------------- 先装X window http://blog.c ...
- C/C++代码静态检查工具PC-lint在VS2008开发环境中的安装配置和使用
PC-Lint偏重于代码的逻辑分析,它能够发现代码中潜在的错误,比如数组访问越界.内存泄漏.使用未初始化变量等. 1. 从http://download.csdn.net/detail/liucha ...
最新文章
- 核心路由器聚焦三大关键点
- irobot扫地机器人 电压_iRobot评测!扫地机器人究竟能有多好用?
- HTTP 1.0 与 1.1比较
- cdrx8如何批量导出jpg_SU基础教程——如何批量导出效果图
- JAVA基础知识总结8(设计模式)
- .NET Core跨平台:使用.NET Core开发一个初心源商城总括
- 欢迎来到Python循环小课堂
- AndroidStudio_Base64图片的解码_编码_要注意的地方---Android原生开发工作笔记223
- Error: EBUSY: resource busy or locked, lstat ‘D:\DumpStack.log.---基于Vue的uniapp手机端_前端UI_uview工作笔记004
- 页面载入时在导航栏显示背景图片
- Halcon PDF文档(hdevelop_users_guide)学习总结之七——关于Halcon语法
- Google Protocol Buffer学习笔记(一)
- 源码安装php5.5
- CentOS 5.11下Oracle 11G R2 Dataguard搭建
- BZOJ1076[SCOI2008] 奖励关
- 《终极算法》读书笔记(二)终极算法
- 给初学日语者的几点建议——词汇篇
- 上亿只“小白鼠”有救了,AI可检测化学物质甚至还更准确
- Nmap下载和简单应用
- 记录一些 arm64指令的用法