Example usage for org.apache.mahout.utils.clustering ClusterDumper run

List of usage examples for org.apache.mahout.utils.clustering ClusterDumper run

Introduction

In this page you can find the example usage for org.apache.mahout.utils.clustering ClusterDumper run.

Prototype

@Override
    public int run(String[] args) throws Exception 

Source Link

Usage

From source file:com.modofo.molo.cluster.Clusterer.java

License:Apache License

public void dump(String topicId, String clusterId) {
    String clusterDir = this.tempDir + "/" + topicId + "/cluster/clusters-" + clusterId;
    String dumpDir = this.tempDir + "/" + topicId + "/cluster/clusters-" + clusterId + "-dump";
    String dicDir = this.tempDir + "/" + topicId + "/" + topicId + "-vectors/dictionary.file-0";
    String[] args = { "-i", clusterDir, "-o", dumpDir, "-d", dicDir, "-dt", "sequencefile", "-b", "100", "-n",
            "20" };
    ClusterDumper cd = new ClusterDumper();
    cd.setConf(new Configuration());
    try {/*  w  w  w .  j  a  v  a 2s. c  om*/
        cd.run(args);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}