## Clustering

The Clustering panel allows to test, tweak and observe how different algorithms perform clustering on samples living in a N-dimensional space: "the canvas".
Clustering can assign a cluster value to each sample, or a contribution of each cluster, or a non-cluster value (for outliers), depending on the algorithm used.
The canvas will display the results of the clustering in multiple layers, which can be toggled using the display options. These are:

- Samples: the original sample data, if the samples have class information, these will be displayed using different colors
- Learned Model: the cluster labels obtained by the algorithm
- Model Info: additional information from the algorithm (gaussian position and shape, support vectors, etc.)
- Density Map: (for 2D canvas only) clustering result for each coordinate in space

In the standard case, a different color is assigned to each cluster. For algorithms providing a contribution from the cluster, a mixing of colors means multiple contributions from different clusters. Be advised that these colors do not correspond to class labels (indeed the data could have no class information whatsoever) but rather they indicate the cluster(s) they have been assigned to.
In Practice
The easiest way to perform clustering is to:

1. Draw some samples (left-click)
2. Click on "Cluster"

This should train the algorithm and start painting the canvas with the results of the clustering
Options and Commands
The interface for clustering (the right-hand side of the Algorithm Options dialog) provides the following commands:

- Cluster: perform the clustering using the currently selected algorithm and options
- One Iteration: (for iterative algorithms only) perform a single iteration of the clustering algorithm
- Clear: clear the current classifier model (does NOT clear the data)
- Manual Selection: manually select the samples used to train the clusterer
- Optimize Clusters: perform multiple clustering with different counts of starting clusters (when applies), compute the clustering quality for each cluster count and pick the optimum within the set range
- Test: compute the clustering quality for a single instance of the clusterer, using the current options

and the following options:

- Optimize by: determine the clustering quality function to be used for the Optimize Clusters command, currently include:

- RSS (Residual Sum of Squares): the squared distance between each sample and the center of its associated cluster
- BIC: Bayesian Information Criterion
- AIC: Akaike Information Criterion
- F1: F-Measure score (requires class-labeled data), compute the F-Measure for each class and each cluster (picks the maximum cluster for each class)

- Train Ratio: amount of data used to compute the curent clustering quality using the Test button

All other options are algorithm-dependent and should be described in the help menu of the algorithm itself.