温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

mahout kmeans怎么使用

发布时间:2021-12-16 16:57:48 来源:亿速云 阅读:149 作者:iii 栏目:云计算

这篇文章主要讲解了“mahout kmeans怎么使用”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“mahout kmeans怎么使用”吧!


Mahout是apache Soft Foundation旗下的一个开源项目
提供一些可扩展的机器学习领域经典算法的实现,旨在帮助开发人员更加方便快捷的创建智能应用程序
Mahout的许多实现,包括聚类,分类,推荐过滤,频繁子项目挖掘,此外,通过使用Apache Hadoop库
Mahout可以有效的扩展到云中
运行Mahout自带的kmeans算法同时验证Mahout是否能够正常运行
准备测试数据下载文件
把文件放在$MAHOUT_HOME目录下synthetic_con
23 17
[hdfs@cloudra ~]$ hadoop fs -mkdir  testdata
[hdfs@cloudra root]$ hadoop fs -mkdir  /output
[hdfs@cloudra ~]$ hadoop fs -put synthetic_control.data testdata
DEPRECATED: Use of this script to execute hdfs command is deprecated.
Instead use the hdfs command for it.
You have new mail in /var/spool/mail/root
/usr/java/default
export JAVA_HOME=/usr/java/jdk1.7.0_79
hdfs@cloudra ~]$ mahout org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
或者 jar mahout-distribution-0.7/mahout-examples-0.7-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job

[root@localhost mahout-distribution-0.9]# hadoop fs -mkdir /user/root/testdata
16/11/23 05:28:02 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
mkdir: `/user/root/testdata': No such file or directory
[root@localhost mahout-distribution-0.9]# hadoop fs -mkdir -p /user/root/testdata
16/11/23 05:28:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
[root@localhost mahout-distribution-0.9]# ls
bin       lib                      mahout-examples-0.9.jar      NOTICE.txt
conf      LICENSE.txt              mahout-examples-0.9-job.jar  README.txt
docs      mahout-core-0.9.jar      mahout-integration-0.9.jar
examples  mahout-core-0.9-job.jar  mahout-math-0.9.jar
[root@localhost mahout-distribution-0.9]# cd ..
[root@localhost soft]# cd ..
[root@localhost ~]# cd -
/root/soft
[root@localhost soft]# ls
data  hadoop-2.6.0  jdk1.7.0_79  mahout-distribution-0.9
[root@localhost soft]# cd data
[root@localhost data]# ls
synthetic_control.data
[root@localhost data]# hadoop fs -put /user/root/testdata
16/11/23 05:29:15 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
put: `/user/root/testdata': No such file or directory
[root@localhost data]# hadoop fs -put synthetic_control.data  /user/root/testdata
16/11/23 05:29:39 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
[root@localhost data]# ls
synthetic_control.data
[root@localhost data]# cd ..
[root@localhost soft]# ls
data  hadoop-2.6.0  jdk1.7.0_79  mahout-distribution-0.9
[root@localhost soft]# cd mahout-distribution-0.9/
[root@localhost mahout-distribution-0.9]# ls
bin       lib                      mahout-examples-0.9.jar      NOTICE.txt
conf      LICENSE.txt              mahout-examples-0.9-job.jar  README.txt
docs      mahout-core-0.9.jar      mahout-integration-0.9.jar
examples  mahout-core-0.9-job.jar  mahout-math-0.9.jar
[root@localhost mahout-distribution-0.9]# hadoop jar mahout-examples-0.9-job.jar org.apache.mahout.clustering.syntheticcontrol.kmeans.Job
16/11/23 05:30:30 INFO kmeans.Job: Running with default arguments
16/11/23 05:30:35 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
16/11/23 05:30:40 INFO kmeans.Job: Preparing Input
16/11/23 05:30:41 INFO client.RMProxy: Connecting to ResourceManager at hadoop02/127.0.0.1:8032
16/11/23 05:30:42 WARN mapreduce.JobSubmitter: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
16/11/23 05:30:46 INFO input.FileInputFormat: Total input paths to process : 1
16/11/23 05:30:46 INFO mapreduce.JobSubmitter: number of splits:1
16/11/23 05:30:47 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1479907436985_0002
16/11/23 05:30:49 INFO impl.YarnClientImpl: Submitted application application_1479907436985_0002
16/11/23 05:30:49 INFO mapreduce.Job: The url to track the job: http://localhost:8088/proxy/application_1479907436985_0002/
16/11/23 05:30:49 INFO mapreduce.Job: Running job: job_1479907436985_0002
16/11/23 05:31:40 INFO mapreduce.Job: Job job_1479907436985_0002 running in uber mode : false
16/11/23 05:31:40 INFO mapreduce.Job:  map 0% reduce 0%
mahout seqdumper将SequenceFile文件转成可读的文本形式对应的源文件是org.apache.mahout.utils.SequenceFileDumper.java将向量文件转化成
可读的文本形式,对应的源文件是org.apache.mahout.utils.vectors.VectorDumper.java
mahout clusterdump分析最后聚类的输出结果,对应的源文件是org.apache.mahout.utils.clustering.ClusterDumper.java
[root@localhost bin]# mahout seqdumper -s output/clusters-5/part-r-00000 -o ~/txt.data
mahout clusterdump --seqFileDir /user/root/output/clusters-10-final --pointsDir /user/root/output/clusteredPoints --output $MAHOUT_HOME/examples/output/clusteranalyze.txt
Mahout包含三大块聚类,协同过滤(推荐item user),分类算法(贝叶斯)
聚类又称为群分析,他是研究(样品或指标)分类的一种统计算法,同时也是数据挖掘的一个重要算法
聚类分析是一个度量的向量,或者是多维空间的一个点
聚类分析已相似性为基础,在一个聚类中模式之间比不在同一聚类的模式之间更有相似性
聚类的用途很广泛,
列入在商业上,聚类可以帮助市场分析人员从消费数据库中区分出不同的消费群体来,并且概括出每一类消费者的消费模式或者说习惯
聚类算法Canopy算法(canopy clustering) K均值算法(k means cluster) 模糊K均值(fuzzy kmeans),EM聚类(期望最大化聚类 EXPECTION MAXMIZATION)
均值漂移聚类(Mean shirt clustering) 层次聚类(hieratical cluster)狄克磊过程聚类(oirichiet process clustering)
latent dinchiet allocation LOA聚类
分类 就是按照某种标准给对象贴标签 ,再根据标签来区分归类
分类是事先定义好类别,类别数不变 比如大豆和绿豆 区分值颜色大小
算法 逻辑回归 (logistic regression) 贝叶斯(Bayesian)支持向量机(Support vector machine)感知器算法
(perceptron and winnow)神经网络(Neural network)随机森林(random forests)
有限玻尔兹曼机(restric boltzman machine)
协同过滤
推荐系统(商品推荐,用户推荐)
推荐/协同过滤   Non-distributed recommenders/(Distribute Recommenders) TasteUserCF(item cf,slotone)/item cf
向量相似度计算 RowSimilantyJob /VectorDistanceJob  计算列间相似度/计算向量间距离
非MR算法  Hidden markov models 马尔科夫模型
集合方法扩展 collocations 扩展了java 的collection类
关联规则挖掘 parallel Fp growth algorithim并行FP growth算法
回归 Locally Weighted Linear Regression 局部加权线性回归
降维 stochastic singular value DeCOMPOSITION奇异值分解/pricipal components Analysis主成分分析/independent components analysis独立成分分析/
gaussian discriminative analysis高斯判别分析
进化算法 并行化watchmake框架

感谢各位的阅读,以上就是“mahout kmeans怎么使用”的内容了,经过本文的学习后,相信大家对mahout kmeans怎么使用这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI