March 2015
Beginner to intermediate
250 pages
5h 39m
English
We will now discuss how to use the clustering algorithm discussed in Java code. Open the MahoutClusteringExample.java file from the chapter7.src package.
Define the distance measure to be used by the k-means clustering algorithm:
DistanceMeasure measure = new EuclideanDistanceMeasure();
We create the Path variable to the input sequence directory created in the preprocessing step:
Path inputSeq = newPath("clustering_seq")
The next step is to generate the random initial cluster seeds. We create the output directory path, where we save the initial cluster points. The path constructor with two arguments creates a folder with the name of the second argument inside the directory of the first argument. You could use a separate ...
Read now
Unlock full access