mahout是直接使用hadoop集群的,参数比较多,具体可以参考书籍或DOC,这里记录初略的使用

一.
# 文本向量化(以路易社的数据为例)
mahout org.apache.lucene.benchmark.utils.ExtractReuters ./reuters-sgm ./reuters-out
hadoop fs -put ./reuters-out /test/reuters-out

mahout seqdirectory -i /test/reuters-out/ -o /test/reuters-seq/ -c UTF-8 -chunk 64 -xm sequential
mahout seq2sparse -i /test/reuters-seq -o /test/reuters-sparse -ow --weight tfidf --maxDFPercent 85 --namedVector
hadoop dfs -ls /test/reuters-sparse
mahout vectordump -i /test/reuters-sparse/tfidf-vectors -n 5

二.
1.
# KMeans聚类
mahout kmeans -i /test/reuters-sparse/tfidf-vectors -c /test/reuters-kmeans-clusters -o /test/reuters-kmeans -k 20 -dm org.apache.mahout.common.distance.CosineDistanceMeasure -x 200 -ow --clustering

# 随机选择中心
hadoop dfs -ls /test/reuters-kmeans-clusters

# 聚类结果
hadoop dfs -ls /test/reuters-kmeans

# 查看簇结果

//新版本不用从hadoop下载下来,直接运行后会把结果下载下来!
//hadoop dfs -get /test/reuters-kmeans/ ./
//hadoop dfs -get /test/reuters-sparse/ ./
mahout clusterdump -i /test/reuters-kmeans/clusters-2-final -d /test/reuters-sparse/dictionary.file-0 -dt sequencefile -o ./reuters-kmeans-cluster-dump/ -n 10

# 聚类结果中重要的是文档被聚到了哪个类(看了很多资料,都没怎么提及)
mahout seqdumper -i /test/reuters-kmeans/clusteredPoints/

2.
# Fuzzy-KMeans聚类(文本处理我们优先使用余弦测距)
mahout fkmeans -i /test/reuters-sparse/tfidf-vectors -c /test/reuters-fkmeans-clusters -o /test/reuters-fkmeans -k 20 -dm org.apache.mahout.common.distance.CosineDistanceMeasure -m 1.05 -x 200 -ow --clustering --convergenceDelta 0.01

# 查看聚类结果
mahout seqdumper -i /test/reuters-fkmeans/clusteredPoints/

3.
# Canopy聚类
mahout canopy -i /test/reuters-sparse/tfidf-vectors -o /test/reuters-canopy-centroids -dm org.apache.mahout.common.distance.CosineDistanceMeasure -t1 140 -t2 80 -ow

# 查看结果
mahout clusterdump -i /test/reuters-canopy-centroids/clusters-0-final -d /test/reuters-sparse/dictionary.file-0 -dt sequencefile -n 20 | vim -

4.
# LDA聚类(LDA使用TF) 概率模型
mahout seq2sparse -i /test/reuters-seq -o /test/reuters-sparse -ow --weight tf --maxDFPercent 50 --namedVector

# Mahout的LDA实现中tf的vector词必须是Ingeter类型,即要我们把word转换成wordid
mahout rowid -i /test/reuters-sparse/tf-vectors -o /test/reuters-cvb-vectoers

#
mahout cvb -i /test/reuters-cvb-vectoers/matrix -dict /test/reuters-sparse/dictionary.file-0 -dt /test/reuters-lda-documents -o /test/reuters-lda -k 20 -x 100 -ow -nt 41807
mahout seqdumper -i /test/reuters-lda-documents
mahout seqdumper -i /test/reuters-lda

使用路易社的数据进行聚类测试相关推荐

  1. 图新地球工程版|同豪路易BIM设计成果、CAD、倾斜模型、纬地数据、影像地形等多源项目数据融合展示汇报

    图新地球工程版是面向公路.基建.电力.水利等工程行业类用户推出的一套全新三维 GIS +工程行业应用解决方案,能够将 路易/同豪BIM设计成果(.skp和.fbx格式).CAD.全景照片.倾斜模型(大 ...

  2. 路易斯·罗森伯格与「群体智能」

    选自 | Gigaom 编译 | 网易智能(smartman163) 参与 | 李擎 与谷歌.Facebook等开发"传统意义上的人工智能"的技术不同,在Unanimous A.I ...

  3. 路易斯安那州立大学计算机科学,西北路易斯安那州立大学

    西北路易斯安那州立大学是1884年成立的美国公立四年制大学,学校占地916英亩.路易斯安那州立大学西北分校是第一批进入美国航天局合资计划的六所学校之一,学生与航天局的科学家们一起工作,帮助分析数据与研 ...

  4. 大数据之路:阿里巴巴大数据实践,附339页PPT下载

    7份关于大数据的资料都整理好了,需要的自取,获取方式:转发+私信我回复:大数据 1.<大数据之路:阿里巴巴大数据实践> 2014年,马云提出,"人类正从IT时代走向DT时代&qu ...

  5. 路易斯安那州立大学计算机科学,路易斯安那州立大学

    路易斯安那州立大学 LouisianaState University 本科桥梁.直录 学校基本概况 学校性质:公立,研究性大学 成立时间:1860年 大学排名:全美129,公立大学排名 62,商科8 ...

  6. 大数据之路读书笔记-16数据应用

    大数据之路读书笔记-16数据应用 全球知名咨询公司麦肯锡称:"数据,已经 透到当今每一个行业和业务职能领域,成为重要的生产要素.人们对于海量数据的挖掘和运用,预示着新一波生产率增长和消费者盈 ...

  7. SitePoint播客#110:路易的首秀

    Episode 110 of The SitePoint Podcast is now available! This week the panel is made up of Louis Simon ...

  8. 易观 CTO 郭炜:易观大数据架构的变迁

    今天跟大家分享易观大数据架构的变迁,包含三部分,第一先给大家讲易观的变化,也是易观产品技术的结果:第二是从技术角度来讲一下易观大数据技术架构的变迁:第三分享一点创新方向的心得. 在过去,大家谈起易观, ...

  9. 用Spark和DBSCAN对地理定位数据进行聚类

    机器学习,特别是聚类算法,可以用来确定哪些地理区域经常被一个用户访问和签到而哪些区域不是.这样的地理分析使多种服务成为可能,比如基于地理位置的推荐系统,先进的安全系统,或更通常来说,提供更个性化的用户 ...

最新文章

  1. 计算机桌面分页,电脑word文档怎么快速分页?
  2. matlab将二值图像与原图重叠_[转载]图像处理matlab及图像融合图像镶嵌图像拼接...
  3. 最新技术前沿与产业风向标来了,百度研究院发布2021年十大趋势
  4. MySql第几行到第几行语句
  5. 基于stm32f103zet6的DS1302学习
  6. neo4j-admin导入海量数据
  7. “java程序打成jar包 如何处理第三方jar包”
  8. Xshell配置ssh免密码登录-密钥公钥(Public key)
  9. 工作流牛人 Jan Mendling
  10. 【java笔记】常用函数式接口(4):Funtion接口
  11. 实验1 小信号调谐放大器(单调谐与双调谐放大器)
  12. Java实现 LeetCode第197场周赛 (题号5460,5461,5211,5463)
  13. 从安防监控走进手机VR 红外线LED翻身
  14. Android常见公有方法(隐藏虚拟按键/隐藏软键盘/获取屏幕宽高等)
  15. ggplot2作图之PcoA
  16. E: 无法定位软件包 mjepgtools
  17. 中国大学慕课公开课-《视听语言》-学习笔记-6
  18. mysql实验总结_数据库实验的心得体会.docx
  19. iOS 8 Change List版本说明 What's New
  20. idea查看每行代码是谁修改的

热门文章

  1. 弱小目标检测跟踪算法研究(4) 基于双边滤波(BF)的红外弱小目标检测之背景抑制Opencv
  2. 赚钱 36 计 - 第七计:定位计
  3. Java实现人脸登录、注册等功能【完整版】
  4. C/C++ 常用缩写词
  5. html图片3djs轮播,原生js实现3D轮播图
  6. 聚名:过期域名抢注的最好时机是什么时候?
  7. Y410P lenovo win8.1 闪屏
  8. JAVA计算机毕业设计携手同游旅游社交平台Mybatis+源码+数据库+lw文档+系统+调试部署
  9. 今年手游玩什么:CP与IP
  10. 大学医用计算机基础期末考试,大学计算机——医学计算基础-中国大学mooc-题库零氪...