List of usage examples for org.apache.mahout.clustering.kmeans KMeansDriver setConf
@Override public void setConf(Configuration conf)
From source file:com.modofo.molo.cluster.Clusterer.java
License:Apache License
public void run(String topicId) { String inputDir = this.tempDir + "/" + topicId + "/" + topicId + "-vectors/tfidf-vectors"; String clusterDir = this.tempDir + "/" + topicId + "-clusters"; String outputDir = this.tempDir + "/" + topicId + "/cluster"; String[] args = { "-i", inputDir, "-c", clusterDir, "-o", outputDir, "-dm", org.apache.mahout.common.distance.CosineDistanceMeasure.class.getName(), "-cd", "0.1", "-x", "10", "-k", "20", "-ow" }; try {/*from w ww . j a v a 2s .co m*/ KMeansDriver kd = new KMeansDriver(); kd.setConf(new Configuration()); kd.run(args); } catch (Exception e) { e.printStackTrace(); } }