linux - 如何使用 Mahout kmeans 算法将集群转储到本地文件系统

标签 linux mahout k-means

我已经按照此( http://sujitpal.blogspot.in/2012/09/learning-mahout-clustering.html )链接创建了初始集群和 k-means 集群,如下面的链接所述,但是当我尝试将集群转储到本地系统时,出现以下错误

hadoop binary is not in PATH,HADOOP_HOME/bin,HADOOP_PREFIX/bin, running locally
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/mahout/mahout-examples-0.8-job.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/mahout/lib/slf4j-jcl-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.JCLLoggerFactory]
Aug 5, 2013 1:21:51 PM org.slf4j.impl.JCLLoggerAdapter info
INFO: Command line arguments: {--dictionary=[vectorfiles/dictionary.file-0], --dictionaryType=[seqfiles], --distanceMeasure=[org.apache.mahout.common.distance.SquaredEuclideanDistanceMeasure], --endPhase=[2147483647], --input=[kmeans-clusters], --numWords=[10], --output=[cluster.txt], --outputFormat=[TEXT], --startPhase=[0], --tempDir=[temp]}
Exception in thread "main" java.lang.IllegalArgumentException: Invalid dictionary format
        at org.apache.mahout.utils.clustering.ClusterDumper.printClusters(ClusterDumper.java:169)
        at org.apache.mahout.utils.clustering.ClusterDumper.run(ClusterDumper.java:156)
        at org.apache.mahout.utils.clustering.ClusterDumper.main(ClusterDumper.java:100)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:68)
        at org.apache.hadoop.util.ProgramDriver.driver(ProgramDriver.java:139)
        at org.apache.mahout.driver.MahoutDriver.main(MahoutDriver.java:194)

转储集群的命令

mahout clusterdump -i kmeans-clusters -d vectorfiles/dictionary.file-* -dt seqfiles -n 10 -o cluster.txt

请建议我如何获得这个

谢谢

最佳答案

我使用了下面的命令及其工作原理

mahout clusterdump -dt sequencefile -d vectorfiles/dictionary.file-0 -i kmeans-clusters/clusters-1-final -o result.txt -b 10 -n 10

关于linux - 如何使用 Mahout kmeans 算法将集群转储到本地文件系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18053674/

相关文章:

java - 无法使用 Java 删除 Linux 中的隐藏文件

java - Mahout:基于项目的推荐系统的调整余弦相似度

hadoop - 在Mahout中根据文本创建矢量的问题

hadoop - 针对Hadoop集群执行Mahout

cluster-analysis - 混合数据类型的聚类

Python - 输入包含 NaN、无穷大或对于 dtype ('float64' 来说太大的值)

php - 提高 MongoDB 聚合管道性能

c - Linux 插入回车换行符而不仅仅是换行符

python - 如何从 Shell 脚本获取循环变量以在 python 脚本中检索

python - 连接不同结果的 2 个值