## K-Means and Fuzzy K-Means Clustering Demo

Some demos showing K-Means Clustering, HAC, and Fuzzy K-Means Clustering in 1D and 2D. The demos are written in Java and source is included.

For running the demos it is required that you have installed Java Web Start on your computer.

### K-Means Demo

This simple application demonstrates the k-means algorithm. It can be very useful for generating nice illustrations as you can create test scenarios using drag&drop and repeat the clustering process with different starting positions for the cluster centroids.

There are basically two modes of operation.

In the first mode, you initialize the system with data, the application creates clusters of data which are generated using a normal (gaussian) distribution (you can select the standard deviation). In the second mode of operation, the k-means algorithm performs step-by-step the association of each data point to an appropriate cluster and displays the result. Additionally a voronoi diagram is drawn to have a better clue about the cluster seperations.

#### Instructions:

- Adjust the sliders to fit your needs (Number of node per cluster, Number of clusters).
- Press the init button, the application generates M clusters with each having N nodes (using the slider values). Now you can move the clusters around by dragging the red boxes. You can also add new cluster by just clicking into the view canvas.
- After you are satisfied with your test setup, press the start button. Now the points are fixed and the initial centroids are drawn. The centroids can also be moved with simple drag&drop.
- When you have finished to setup the initial centroid position you can press either step or run. When pressing step, the algorithm performs one single step. Pressing run has the effect that the application runs until the algorithm converges (max. 20 iterations).
- Pressing reset causes the test setup to be reset to the state before pressing start.

Download and Start Application here

### Fuzzy K-Means Demo

This application demonstrates the fuzzy k-means algorithm with a 1-dimensional test setup. Like the k-means demo you can change the test setup using drag&drop for both, data points, and cluster centroids. Also, the modes of operation stay the same as before. First, initialize the demo with data, change the data to fit your needs, and finally let the algorithm do the work. Additionally, to drawing the data points and cluster centroids, also the membership function is drawn to get a clue how it has an effect of clustering results.

#### Instructions:

- Adjust the sliders to fit your needs (Number of points, Number of clusters).
- Press the init button, the application generates N points and M centroids (using the slider values). Now you can move the data points around by dragging them. The centroids can also be moved with simple drag&drop.
- After you are satisfied with your test setup, press the start button. Now the points are fixed and the initial membership function is drawn.
- When you have finished to setup the initial centroid position you can press either step or run. When pressing step, the algorithm performs one single step. Pressing run has the effect that the application runs until the algorithm converges (max. 20 iterations). Max membership change is used as convergence criteria and is checked against your accuracy setting.
- Pressing reset causes the test setup to be reset to the state before pressing start.

Download and Start Application here

### HAC Demo

This application demonstrates the hac algorithm with a 2-dimensional test setup. It is quite similar to the other 2 demo applications as you can tune your test setup using the appropriate slider (number of nodes) and simply drag&drop the points. Additionally, there is a second view integrated that will display the dendrogram of the clusters detected by the hac algorithm. There are 3 different algorithms implemented: Single-Link, Complete-Link, and Average-Link. When the algorithm is working (e.g. in step mode) it is also possible to measure distances between the data points. Simply move your mouse over a data point and depending on the selected linkage method the distance to the other clusters is calculated and displayed.

#### Instructions

- Adjust the slider to fit your needs (Number of points).
- Press the init button, the application generates N points. Now you can move the data points around by dragging them. You can also add additional data points by just clicking into the view.
- After you are satisfied with your test setup, press the start button. Now the points are fixed and the initial dendrogram is drawn.
- Now you can press either step or run. When pressing step, the algorithm performs one single step. Pressing run has the effect that the application runs until only one top cluster is left.
- While the algorithm is running, you can measure distances between the several clusters by simply moving the mouse over the data points.
- Pressing reset causes the test setup to be reset to the state before pressing start.

Download and Start Application here

Download Source:

Clusterdemos.src 57,53 kB