mahout聚类结果的输出和可视化
2016-11-30 21:15
316 查看
1、在mahout中,org.apache.mahout.utils.clustering.ClusterDumper类可以将聚类结果输出,如果是打印在控制台,则可以使用:
ClusterDumper clusterdumper=new ClusterDumper(sequentialfile,clusterpoints);
clusterdumper.printClusters(null);
其中第一个参数表示聚类结果的簇中心序列化的文件路径的path类,第二个参数表示聚类结果的中心序列化文件路径的path类
如果要输出到文件,则可以在控制台通过命令运行该ClusterDumper.java文件,如何要在eclipse中运行的话,则给ClusterDumper.java添加所需要的参数,然后run即可,参数说明如下:
其中红色的部分参数是必须的。
2、可视化聚类结果:
在mahout源码中,org.apache.mahout.clustering.display包下有对应的可视化类,之间运行即可看到结果,是用java swing写的
ClusterDumper clusterdumper=new ClusterDumper(sequentialfile,clusterpoints);
clusterdumper.printClusters(null);
其中第一个参数表示聚类结果的簇中心序列化的文件路径的path类,第二个参数表示聚类结果的中心序列化文件路径的path类
如果要输出到文件,则可以在控制台通过命令运行该ClusterDumper.java文件,如何要在eclipse中运行的话,则给ClusterDumper.java添加所需要的参数,然后run即可,参数说明如下:
--help Print out help --input (-i) input The directory containing Sequence Files for the Clusters (聚类结果的序列化的簇中心文件路径) --output (-o) output The output file. If not specified,(反序列化后的结果输出路径) dumps to the console. --outputFormat (-of) outputFormat The optional output format to write the results as. Options: TEXT, CSV, or GRAPH_ML --substring (-b) substring The number of chars of the asFormatString() to print --pointsDir (-p) pointsDir The directory containing points sequence files mapping input vectors to their cluster. If specified, then the program will output the points associated with a cluster (聚类结果的数据点序列化文件) --dictionary (-d) dictionary The dictionary file. --dictionaryType (-dt) dictionaryType The dictionary file type (text|sequencefile) --distanceMeasure (-dm) distanceMeasure The classname of the DistanceMeasure. Default is SquaredEuclidean. --numWords (-n) numWords The number of top terms to print --tempDir tempDir Intermediate output directory --startPhase startPhase First phase to run --endPhase endPhase Last phase to run --evaluate (-e) Run ClusterEvaluator and CDbwEvaluator over the input. The output will be appended to the rest of the output at the end.
其中红色的部分参数是必须的。
2、可视化聚类结果:
在mahout源码中,org.apache.mahout.clustering.display包下有对应的可视化类,之间运行即可看到结果,是用java swing写的
相关文章推荐
- TF之NN:matplotlib动态演示深度学习之tensorflow将神经网络系统自动学习并优化修正并且将输出结果可视化—Jason niu
- Dawid 等人 如何利用 AdunaClusterMap 编写生成 可视化聚类结果
- mahout 将聚类结果展示在网页上
- 4.编程实现k-means算法,针对下表数据,在给定k=3的情况下,输出聚类结果。
- [聚类结果可视化] 此文中比较了 Aduna ClusterMap和 Prefuse
- ggplot2_聚类结果可视化
- 使用百度地图api可视化聚类结果
- 一个解读聚类分析的可视化结果的例子
- 输出1-1/2+1/3-1/4+...-1/99+1/100的结果
- c++ 64位二进制 移位运算并输出结果
- Web Mapping for Silverlight:拉框查询,并将结果输出到表格中
- Mahout机器学习系列之-模糊c-均值聚类和狄利克雷过程聚类
- python 捕获 shell/bash 脚本的输出结果实例
- 开启3个线程,这3个线程的ID分别为A、B、C,每个线程将自己的ID在屏幕上打印10遍,要求输出结果必须按ABC的顺序显示;如:ABCABC….依次递推:
- 需找符合条件的整数(输入整数N,输出一个最小自然数M,使N*M结果只包含1跟0)
- shell 不同颜色输出结果的简单例子
- 在1、2、3...9(保持这个顺序)之间可任意放+或者-或者不放,使其结果等于100,输出所有可能的放法。js写法
- 【java基础】Class.getName()输出结果的解释
- 输入一个字符串,按字典序打印出该字符串中字符的所有排列。例如输入字符串abc,则打印出由字符a,b,c所能排列出来的所有字符串abc,acb,bac,bca,cab和cba。 结果请按字母顺序输出。
- 试问这段代码输出何种结果