Apache Mahout > Mahout Wiki > Viewing Result > Visualizing Sample Clusters |
Mahout provides examples to visualize sample clusters that gets created by various clustering algorithms like
These are Swing programs. You have to be in a window system on the same machine you run these, or logged in via a "remote desktop" or VNC program.
For visualizing the clusters, you would just have to execute the Java classes under org.apache.mahout.clustering.display package in mahout-examples module. If you are using eclipse, setup mahout-examples as a project as specified in Working with Maven in Eclipse.
The following classes in org.apache.mahout.clustering.display can be run without parameters to generate a sample data set and run the reference clustering implementations over them:
If you are using Eclipse and have set it up as specified in Pre-Prep, just right-click on each of the classes mentioned above and choose "Run As - Java Application". To run these directly from the command line:
cd $MAHOUT_HOME/examples mvn -q exec:java -Dexec.mainClass=org.apache.mahout.clustering.display.DisplayClustering # substitute other names above for DisplayClustering # Note: the DisplaySpectralKMeans program does a Hadoop job that takes 3 minutes on a laptop. Set this MVN_OPTS=300m to give the program enough memory. You may find that some of the other programs also need more memory.
Note:
See Sample Clusters Animation for a screen caps of all the above programs, and an animated gif.