### Class Definition: `GapEvaluation`

statistics: obj = evalclusters (x, clust, `gap`)
statistics: obj = evalclusters (…, `Name`, `Value`)

A gap object to evaluate clustering solutions.

A `GapEvaluation` object is a `ClusterCriterion` object used to evaluate clustering solutions using the gap criterion, which is a mathematical formalization of the elbow method.

List of public properties specific to `SilhouetteEvaluation`:

``B``

the number of reference datasets to generate.

``Distance``

a valid distance metric name, or a function handle as accepted by the `pdist` function.

``ExpectedLogW``

a vector of the expected values for the logarithm of the within clusters dispersion.

``LogW``

a vector of the values of the logarithm of the within clusters dispersion.

``ReferenceDistribution``

a valid name for the reference distribution, namely: `PCA` (default) or `uniform`.

``SE``

a vector of the standard error of the expected values for the logarithm of the within clusters dispersion.

``SearchMethod``

a valid name for the search method to use: `globalMaxSE` (default) or `firstMaxSE`.

``StdLogW``

a vector of the standard deviation of the expected values for the logarithm of the within clusters dispersion.

The best solution according to the gap criterion depends on the chosen search method. When the search method is `globalMaxSE`, the chosen gap value is the smaller one which is inside a standard error from the max gap value; when the search method is `firstMaxSE`, the chosen gap value is the first one which is inside a standard error from the next gap value.

See also: evalclusters, ClusterCriterion, CalinskiHarabaszEvaluation, DaviesBouldinEvaluation, SilhouetteEvaluation

Source Code: GapEvaluation

### Method: `addK`

GapEvaluation: obj = addK (obj, K)

Add a new cluster array to inspect the GapEvaluation object.

### Method: `compact`

GapEvaluation: obj = compact (obj)

Return a compact GapEvaluation object (not implemented yet).

### Method: `plot`

ClusterCriterion: plot (obj)
ClusterCriterion: h = plot (obj)

Plot the evaluation results.

Plot the CriterionValues against InspectedK from the GapEvaluation ClusterCriterion, obj, and show the standard deviation to the current plot. It can also return a handle to the current plot.