I've written a code to cluster a group of data in Java. I am using Apache Mahout to build clusters. Here is the piece of my code:
Configuration conf = new Configuration();
Path input = new Path("C:\\DATA\\input.txt");
Path clusters = new Path("C:\\DATA\\clusters.txt");
Path output = new Path("C:\\DATA\\output.txt");
org.apache.mahout.common.distance.DistanceMeasure measure;
String delta = new InterruptedException().toString();
org.apache.mahout.clustering.kmeans.KMeansDriver myK = new KMeansDriver();
myK.buildClusters(conf, input, clusters, output, measure, 100, delta, true);
But I get an error during creation of "measure" parameter : "variable measure might not have been initialized".
Here is the doc of function buildClusters: https://builds.apache.org/job/Mahout-Quality/javadoc/org/apache/mahout/clustering/kmeans/KMeansDriver.html
So, how can I define the true value of "measure"?
DistanceMeasure
(link) is just an Interface. You need to use one of the implementations of the interface, for example CosineDistanceMeasure
or EuclideanDistanceMeasure
By the way, I wonder why your delta is defined like this: String delta = new InterruptedException().toString();
delta
is defined as the convergence delta value, which internally is parsed as a double.