# doc-cache created by Octave 11.2.0
# name: cache
# type: cell
# rows: 3
# columns: 112
# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
CalinskiHarabaszEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 755
statistics: CalinskiHarabaszEvaluation

Calinski-Harabasz clustering evaluation.

A CalinskiHarabaszEvaluation object contains the results of
evaluating clustering solutions using the Calinski-Harabasz criterion.

The Calinski-Harabasz index (also known as the Variance Ratio Criterion) is
determined by the ratio of the between-cluster sum of squares (SSB) to the
within-cluster sum of squares (SSW). A higher Calinski-Harabasz index
value indicates a better clustering solution, implying that clusters are
dense and well-separated.

Create a CalinskiHarabaszEvaluation object by using the
evalclusters function with the 'CalinskiHarabasz' criterion.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
Calinski-Harabasz clustering evaluation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 53
CalinskiHarabaszEvaluation.CalinskiHarabaszEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 982
statistics: obj = CalinskiHarabaszEvaluation ( x , clust , KList )

Construct a CalinskiHarabaszEvaluation object to evaluate
clustering solutions with the Calinski-Harabasz criterion.

obj = CalinskiHarabaszEvaluation ( x , clust ,
KList ) clusters the data in x for every cluster count in
KList and evaluates each solution. The evaluation runs at
construction, so obj arrives with its CriterionValues and
OptimalK already set.

x is an N&times;P numeric matrix of observations (rows)
and predictors (columns). A row holding a NaN is left out of
NumObservations .
clust names the clustering method, one of
'kmeans' , 'linkage' and 'gmdistribution' ; or a
function handle that clusters the data; or an N&times;M numeric matrix
of clustering solutions computed elsewhere, one column per cluster
count, in which case ClusteringFunction is left empty.
KList is a vector of positive integers, the cluster counts
to inspect.

evalclusters is the usual way to create one of these objects.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 116
Construct a CalinskiHarabaszEvaluation object to evaluate clustering solutions with the Calinski-Harabasz criterion.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
CalinskiHarabaszEvaluation.ClusteringFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
ClusterCriterion: property ClusteringFunction

Clustering algorithm

A character vector or a function handle specifying the clustering
algorithm used to generate the clustering solutions. It can be empty if
the clustering solutions are passed as an input matrix. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Clustering algorithm



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 40
CalinskiHarabaszEvaluation.CriterionName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClusterCriterion: property CriterionName

Name of the evaluation criterion

A character vector specifying the name of the criterion used to evaluate
the clustering solutions. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Name of the evaluation criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CalinskiHarabaszEvaluation.CriterionValues


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClusterCriterion: property CriterionValues

Criterion values

A numeric vector containing the values generated by the evaluation
criterion for each clustering solution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Criterion values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
CalinskiHarabaszEvaluation.InspectedK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClusterCriterion: property InspectedK

List of the number of clusters

A numeric vector containing the list of the number of clusters evaluated.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
List of the number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
CalinskiHarabaszEvaluation.Missing


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
ClusterCriterion: property Missing

Missing values

A logical vector indicating which observations in the data matrix contain
missing values ( NaN ). This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Missing values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
CalinskiHarabaszEvaluation.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
ClusterCriterion: property NumObservations

Number of observations

An integer specifying the number of non-missing observations in the data
matrix. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CalinskiHarabaszEvaluation.OptimalK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClusterCriterion: property OptimalK

Optimal number of clusters

An integer specifying the optimal number of clusters based on the
evaluation criterion. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Optimal number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
CalinskiHarabaszEvaluation.OptimalY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
ClusterCriterion: property OptimalY

Optimal clustering solution

A numeric vector representing the clustering solution that corresponds to
the optimal number of clusters. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Optimal clustering solution



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
CalinskiHarabaszEvaluation.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClusterCriterion: property X

Data used for clustering

A numeric matrix containing the data used for clustering. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Data used for clustering



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CalinskiHarabaszEvaluation.addK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 304
CalinskiHarabaszEvaluation: obj = addK ( obj , K )

Add new cluster sizes for evaluation.

addK ( obj , K ) evaluates clustering solutions for the
number of clusters specified in the vector K and adds them to the
CalinskiHarabaszEvaluation object obj .

See also:
CalinskiHarabaszEvaluation,
evalclusters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
Add new cluster sizes for evaluation.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
CalinskiHarabaszEvaluation.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 396
CalinskiHarabaszEvaluation: plot ( obj )
CalinskiHarabaszEvaluation: h = plot ( obj )

Plot the clustering evaluation results.

plot ( obj ) plots the Calinski-Harabasz criterion values
against the number of clusters. The optimal number of clusters is marked
with an asterisk.

h = plot ( obj ) additionally returns the handle to the
plot axes.

See also:
CalinskiHarabaszEvaluation,
evalclusters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Plot the clustering evaluation results.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
ClusterCriterion


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 341
statistics: ClusterCriterion

A clustering evaluation object.

The ClusterCriterion is a superclass for clustering evaluation
objects, which are created by the evalclusters function. It is not
meant to be instantiated directly.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
A clustering evaluation object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
ClusterCriterion.ClusterCriterion


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 227
ClusterCriterion: obj = ClusterCriterion ( x , clust , KList )

Create a ClusterCriterion object.

ClusterCriterion is a superclass and is not meant to be
instantiated directly. Use evalclusters instead.

See also:
evalclusters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Create a ClusterCriterion object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
ClusterCriterion.ClusteringFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
ClusterCriterion: property ClusteringFunction

Clustering algorithm

A character vector or a function handle specifying the clustering
algorithm used to generate the clustering solutions. It can be empty if
the clustering solutions are passed as an input matrix. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Clustering algorithm



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
ClusterCriterion.CriterionName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClusterCriterion: property CriterionName

Name of the evaluation criterion

A character vector specifying the name of the criterion used to evaluate
the clustering solutions. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Name of the evaluation criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClusterCriterion.CriterionValues


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClusterCriterion: property CriterionValues

Criterion values

A numeric vector containing the values generated by the evaluation
criterion for each clustering solution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Criterion values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
ClusterCriterion.InspectedK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClusterCriterion: property InspectedK

List of the number of clusters

A numeric vector containing the list of the number of clusters evaluated.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
List of the number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClusterCriterion.Missing


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
ClusterCriterion: property Missing

Missing values

A logical vector indicating which observations in the data matrix contain
missing values ( NaN ). This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Missing values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
ClusterCriterion.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
ClusterCriterion: property NumObservations

Number of observations

An integer specifying the number of non-missing observations in the data
matrix. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClusterCriterion.OptimalK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClusterCriterion: property OptimalK

Optimal number of clusters

An integer specifying the optimal number of clusters based on the
evaluation criterion. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Optimal number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
ClusterCriterion.OptimalY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
ClusterCriterion: property OptimalY

Optimal clustering solution

A numeric vector representing the clustering solution that corresponds to
the optimal number of clusters. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Optimal clustering solution



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
ClusterCriterion.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClusterCriterion: property X

Data used for clustering

A numeric matrix containing the data used for clustering. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Data used for clustering



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
ClusterCriterion.addK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 166
ClusterCriterion: obj = addK ( obj , k )

Add a new list of cluster numbers to evaluate.

addK adds a new list of cluster numbers, k , to the
ClusterCriterion object.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Add a new list of cluster numbers to evaluate.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
ClusterCriterion.compact


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 639
ClusterCriterion: obj = compact ( obj )

Create a compact clustering evaluation object.

obj = compact ( obj ) returns an object of the same
class holding the results of the evaluation but none of the data it was
computed from, which is useful when the evaluation is kept and the
sample is large.

X , Missing and OptimalY are emptied; InspectedK ,
CriterionValues , OptimalK , NumObservations ,
CriterionName and ClusteringFunction are kept. The object
compacted from is not changed.

A compacted object can still be displayed and plotted, and compacting
one again does nothing, but addK raises: there are no
observations left to cluster.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 46
Create a compact clustering evaluation object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
ClusterCriterion.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 279
ClusterCriterion: h = plot ( obj )

Plot the clustering evaluation values.

plot generates a plot of the criterion values against the number
of clusters.

The optimal number of clusters is marked with an asterisk.

The optional return value, h , is a graphics handle to the plot.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Plot the clustering evaluation values.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
DaviesBouldinEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 637
statistics: DaviesBouldinEvaluation

Davies-Bouldin object to evaluate clustering solutions

A DaviesBouldinEvaluation object is a ClusterCriterion
object used to evaluate clustering solutions using the Davies-Bouldin
criterion.

The Davies-Bouldin criterion is based on the ratio between the distances
between clusters and within clusters, that is between centroids and
between each datapoint and its centroid.

The best solution according to the Davies-Bouldin criterion is the one
that produces the lowest Davies-Bouldin value.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 54
Davies-Bouldin object to evaluate clustering solutions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 42
DaviesBouldinEvaluation.ClusteringFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
ClusterCriterion: property ClusteringFunction

Clustering algorithm

A character vector or a function handle specifying the clustering
algorithm used to generate the clustering solutions. It can be empty if
the clustering solutions are passed as an input matrix. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Clustering algorithm



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 37
DaviesBouldinEvaluation.CriterionName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClusterCriterion: property CriterionName

Name of the evaluation criterion

A character vector specifying the name of the criterion used to evaluate
the clustering solutions. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Name of the evaluation criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
DaviesBouldinEvaluation.CriterionValues


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClusterCriterion: property CriterionValues

Criterion values

A numeric vector containing the values generated by the evaluation
criterion for each clustering solution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Criterion values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
DaviesBouldinEvaluation.DaviesBouldinEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 970
statistics: obj = DaviesBouldinEvaluation ( x , clust , KList )

Construct a DaviesBouldinEvaluation object to evaluate clustering
solutions with the Davies-Bouldin criterion.

obj = DaviesBouldinEvaluation ( x , clust ,
KList ) clusters the data in x for every cluster count in
KList and evaluates each solution. The evaluation runs at
construction, so obj arrives with its CriterionValues and
OptimalK already set.

x is an N&times;P numeric matrix of observations (rows)
and predictors (columns). A row holding a NaN is left out of
NumObservations .
clust names the clustering method, one of
'kmeans' , 'linkage' and 'gmdistribution' ; or a
function handle that clusters the data; or an N&times;M numeric matrix
of clustering solutions computed elsewhere, one column per cluster
count, in which case ClusteringFunction is left empty.
KList is a vector of positive integers, the cluster counts
to inspect.

evalclusters is the usual way to create one of these objects.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 110
Construct a DaviesBouldinEvaluation object to evaluate clustering solutions with the Davies-Bouldin criterion.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
DaviesBouldinEvaluation.InspectedK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClusterCriterion: property InspectedK

List of the number of clusters

A numeric vector containing the list of the number of clusters evaluated.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
List of the number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
DaviesBouldinEvaluation.Missing


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
ClusterCriterion: property Missing

Missing values

A logical vector indicating which observations in the data matrix contain
missing values ( NaN ). This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Missing values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
DaviesBouldinEvaluation.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
ClusterCriterion: property NumObservations

Number of observations

An integer specifying the number of non-missing observations in the data
matrix. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
DaviesBouldinEvaluation.OptimalK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClusterCriterion: property OptimalK

Optimal number of clusters

An integer specifying the optimal number of clusters based on the
evaluation criterion. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Optimal number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
DaviesBouldinEvaluation.OptimalY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
ClusterCriterion: property OptimalY

Optimal clustering solution

A numeric vector representing the clustering solution that corresponds to
the optimal number of clusters. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Optimal clustering solution



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
DaviesBouldinEvaluation.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClusterCriterion: property X

Data used for clustering

A numeric matrix containing the data used for clustering. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Data used for clustering



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
DaviesBouldinEvaluation.addK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 122
DaviesBouldinEvaluation: obj = addK ( obj , K )

Add new cluster numbers to inspect in the DaviesBouldinEvaluation object.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 73
Add new cluster numbers to inspect in the DaviesBouldinEvaluation object.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
DaviesBouldinEvaluation.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 273
DaviesBouldinEvaluation: plot ( obj )
DaviesBouldinEvaluation: h = plot ( obj )

Plot Davies-Bouldin evaluation results.

Plot the CriterionValues against InspectedK from the
DaviesBouldinEvaluation ClusterCriterion to the current plot.
Returns an axes handle if requested.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Plot Davies-Bouldin evaluation results.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 13
GapEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 643
statistics: GapEvaluation

Gap evaluation for clustering solutions

The GapEvaluation class implements the gap statistic criterion for
evaluating clustering solutions. A GapEvaluation object is a
specialization of ClusterCriterion and contains fields and methods
to compute the gap statistic, its Monte-Carlo reference expectations, and
to select the optimal number of clusters according to a chosen search
method.

Create a GapEvaluation object by using the evalclusters
function or by calling the class constructor directly.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Gap evaluation for clustering solutions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
GapEvaluation.B


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 238
GapEvaluation: property B

Number of reference datasets

A positive integer specifying how many reference datasets are generated
to compute the expected log within-cluster dispersion via Monte-Carlo
simulation. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Number of reference datasets



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
GapEvaluation.ClusteringFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
ClusterCriterion: property ClusteringFunction

Clustering algorithm

A character vector or a function handle specifying the clustering
algorithm used to generate the clustering solutions. It can be empty if
the clustering solutions are passed as an input matrix. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Clustering algorithm



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
GapEvaluation.CriterionName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClusterCriterion: property CriterionName

Name of the evaluation criterion

A character vector specifying the name of the criterion used to evaluate
the clustering solutions. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Name of the evaluation criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
GapEvaluation.CriterionValues


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClusterCriterion: property CriterionValues

Criterion values

A numeric vector containing the values generated by the evaluation
criterion for each clustering solution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Criterion values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
GapEvaluation.Distance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 289
GapEvaluation: property Distance

Distance metric

A character vector or function handle specifying the distance measure
passed to clustering routines (as accepted by pdist ). When a
numeric vector is supplied it is interpreted as a precomputed distance
vector. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Distance metric



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
GapEvaluation.ExpectedLogW


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 291
GapEvaluation: property ExpectedLogW

Expected log within-cluster dispersion

A numeric vector containing the Monte-Carlo estimate of the expected
values for the natural logarithm of the within-cluster dispersion,
computed across the generated reference datasets. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Expected log within-cluster dispersion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
GapEvaluation.GapEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 895
statistics: obj = GapEvaluation ( x , clust , KList )
statistics: obj = GapEvaluation ( x , clust , KList , B )
statistics: obj = GapEvaluation (&hellip;, name , value )

Construct a GapEvaluation object to evaluate clustering solutions using
the gap statistic.

obj = GapEvaluation ( x , clust , KList )
returns a GapEvaluation object configured to evaluate the
clustering function specified by clust on the data matrix
x for the list of cluster counts in KList .

Optional inputs:

B - Number of reference datasets to generate (default 100).
'Distance' - Distance metric name or function handle as
accepted by pdist (default 'sqeuclidean' ).
'ReferenceDistribution' - Reference distribution to use
(default 'pca' ; 'uniform' is supported).
'SearchMethod' - Method to select the optimal K; one of
'globalMaxSE' or 'firstMaxSE' (default
'globalMaxSE' ).

See also:
evalclusters,
ClusterCriterion


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 90
Construct a GapEvaluation object to evaluate clustering solutions using the gap statistic.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
GapEvaluation.InspectedK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClusterCriterion: property InspectedK

List of the number of clusters

A numeric vector containing the list of the number of clusters evaluated.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
List of the number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
GapEvaluation.LogW


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 232
GapEvaluation: property LogW

Observed log within-cluster dispersion

A numeric vector containing the observed values of the natural
logarithm of the within-cluster dispersion computed on the actual data.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Observed log within-cluster dispersion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
GapEvaluation.Missing


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
ClusterCriterion: property Missing

Missing values

A logical vector indicating which observations in the data matrix contain
missing values ( NaN ). This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Missing values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
GapEvaluation.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
ClusterCriterion: property NumObservations

Number of observations

An integer specifying the number of non-missing observations in the data
matrix. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
GapEvaluation.OptimalK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClusterCriterion: property OptimalK

Optimal number of clusters

An integer specifying the optimal number of clusters based on the
evaluation criterion. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Optimal number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
GapEvaluation.OptimalY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
ClusterCriterion: property OptimalY

Optimal clustering solution

A numeric vector representing the clustering solution that corresponds to
the optimal number of clusters. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Optimal clustering solution



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
GapEvaluation.ReferenceDistribution


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 251
GapEvaluation: property ReferenceDistribution

Reference distribution for Monte-Carlo

A character vector naming the reference distribution used to generate
reference datasets. Supported values include 'pca' and
'uniform' . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 38
Reference distribution for Monte-Carlo



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
GapEvaluation.SE


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 218
GapEvaluation: property SE

Standard error of expected logW

A numeric vector containing the standard error of the expected values
for the natural logarithm of the within-cluster dispersion. This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
Standard error of expected logW



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
GapEvaluation.SearchMethod


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 269
GapEvaluation: property SearchMethod

Search method to select optimal K

A character vector specifying the method used to select the optimal
number of clusters from the gap statistic. Supported values include
'globalMaxSE' and 'firstMaxSE' . This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Search method to select optimal K



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
GapEvaluation.StdLogW


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 215
GapEvaluation: property StdLogW

Standard deviation of expected logW

A numeric vector containing the standard deviation of the Monte-Carlo
estimates of the log within-cluster dispersion. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 35
Standard deviation of expected logW



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
GapEvaluation.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClusterCriterion: property X

Data used for clustering

A numeric matrix containing the data used for clustering. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Data used for clustering



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
GapEvaluation.addK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 235
GapEvaluation: obj = addK ( obj , K )

Add new K values to inspect

Add a new cluster array to inspect in the GapEvaluation object.
This updates internal storage for Monte-Carlo results and evaluates the
newly requested cluster counts.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Add new K values to inspect



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
GapEvaluation.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 281
GapEvaluation: plot ( obj )
GapEvaluation: h = plot ( obj )

Plot Gap evaluation results

Plot the gap statistic (criterion values) versus the inspected numbers
of clusters and display error bars representing the Monte-Carlo
standard deviations. Optionally returns the axes handle.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Plot Gap evaluation results



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
SilhouetteEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1262
statistics: SilhouetteEvaluation

Silhouette evaluation for clustering

The SilhouetteEvaluation class implements an object to evaluate
clustering solutions using the silhouette criterion. A
SilhouetteEvaluation object is a ClusterCriterion object
that computes silhouette values for clustering solutions and selects the
best number of clusters as the one with the highest average silhouette
value.

Create a SilhouetteEvaluation object by using the
evalclusters function or the class constructor.

List of public properties specific to SilhouetteEvaluation :

Distance
A valid distance metric name (string), a function handle, or a numeric
vector as returned by pdist . This specifies how pairwise
distances are computed.
ClusterPriors
A character vector specifying how to evaluate silhouette values across
clusters: 'empirical' (default) uses empirical cluster priors,
or 'equal' treats clusters equally.
ClusterSilhouettes
A cell array containing silhouette values for each observation for each
inspected cluster number.

The best clustering solution according to the silhouette criterion is the
one that yields the highest average silhouette value.

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


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
Silhouette evaluation for clustering



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
SilhouetteEvaluation.ClusterPriors


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 214
SilhouetteEvaluation: property ClusterPriors

Cluster prior handling

Specifies how cluster-level silhouette aggregation is computed. Valid
values are 'empirical' (default) and 'equal' . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Cluster prior handling



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
SilhouetteEvaluation.ClusterSilhouettes


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 286
SilhouetteEvaluation: property ClusterSilhouettes

Silhouette values

A cell array where each element holds the mean silhouette value of
each cluster of a given clustering (corresponding to an inspected K),
so element i is a vector of InspectedK( i ) values.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
Silhouette values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
SilhouetteEvaluation.ClusteringFunction


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 290
ClusterCriterion: property ClusteringFunction

Clustering algorithm

A character vector or a function handle specifying the clustering
algorithm used to generate the clustering solutions. It can be empty if
the clustering solutions are passed as an input matrix. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
Clustering algorithm



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
SilhouetteEvaluation.CriterionName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 202
ClusterCriterion: property CriterionName

Name of the evaluation criterion

A character vector specifying the name of the criterion used to evaluate
the clustering solutions. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 32
Name of the evaluation criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
SilhouetteEvaluation.CriterionValues


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 196
ClusterCriterion: property CriterionValues

Criterion values

A numeric vector containing the values generated by the evaluation
criterion for each clustering solution. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Criterion values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
SilhouetteEvaluation.Distance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 207
SilhouetteEvaluation: property Distance

Distance measure

A string naming a distance metric, a function handle that computes
distances, or a numeric vector as produced by pdist . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
Distance measure



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
SilhouetteEvaluation.InspectedK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 172
ClusterCriterion: property InspectedK

List of the number of clusters

A numeric vector containing the list of the number of clusters evaluated.
This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
List of the number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
SilhouetteEvaluation.Missing


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 177
ClusterCriterion: property Missing

Missing values

A logical vector indicating which observations in the data matrix contain
missing values ( NaN ). This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
Missing values



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
SilhouetteEvaluation.NumObservations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 176
ClusterCriterion: property NumObservations

Number of observations

An integer specifying the number of non-missing observations in the data
matrix. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
Number of observations



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
SilhouetteEvaluation.OptimalK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 180
ClusterCriterion: property OptimalK

Optimal number of clusters

An integer specifying the optimal number of clusters based on the
evaluation criterion. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 26
Optimal number of clusters



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
SilhouetteEvaluation.OptimalY


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 199
ClusterCriterion: property OptimalY

Optimal clustering solution

A numeric vector representing the clustering solution that corresponds to
the optimal number of clusters. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
Optimal clustering solution



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
SilhouetteEvaluation.SilhouetteEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 810
statistics: obj = SilhouetteEvaluation ( x , clust , KList )
statistics: obj = SilhouetteEvaluation (&hellip;, Name , Value )

Create a SilhouetteEvaluation object to evaluate clustering
solutions for data x using clustering method clust over the
list of cluster numbers KList .

x is an N&times;P numeric matrix of observations (rows) and
predictors (columns).

clust is a string naming the clustering method (for example
'kmeans' , 'linkage' , or a custom function handle).

KList is a vector of positive integers specifying the cluster
numbers to inspect.

Optional name-value pairs:

Name Value
'Distance' Distance metric name, function handle,
or numeric pdist vector. Default: 'sqeuclidean' .
'ClusterPriors' Either 'empirical'
(default) or 'equal' .

See also:
silhouette,
evalclusters,
ClusterCriterion


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 150
Create a SilhouetteEvaluation object to evaluate clustering solutions for data x using clustering method clust over the list of cluster numbers KList.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
SilhouetteEvaluation.X


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 141
ClusterCriterion: property X

Data used for clustering

A numeric matrix containing the data used for clustering. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Data used for clustering



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
SilhouetteEvaluation.addK


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 148
SilhouetteEvaluation: obj = addK ( obj , K )

Add a new cluster number to inspect and re-evaluate silhouette values
for newly added cluster numbers.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 102
Add a new cluster number to inspect and re-evaluate silhouette values for newly added cluster numbers.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
SilhouetteEvaluation.plot


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 280
SilhouetteEvaluation: plot ( obj )
SilhouetteEvaluation: h = plot ( obj )

Plot the silhouette evaluation results.

Plot the criterion values (average silhouette) against inspected cluster
numbers ( InspectedK ) for the given obj . Optionally returns
the axis handle for the plot.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Plot the silhouette evaluation results.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
cluster


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1145
statistics: T = cluster ( Z , "Cutoff", C )
statistics: T = cluster ( Z , "Cutoff", C , "Depth", D )
statistics: T = cluster ( Z , "Cutoff", C , "Criterion", criterion )
statistics: T = cluster ( Z , "MaxClust", N )

Define clusters from an agglomerative hierarchical cluster tree.

Given a hierarchical cluster tree Z generated by the linkage
function, cluster defines clusters, using a threshold value C to
identify new clusters (&rsquo;Cutoff&rsquo;) or according to a maximum number of desired
clusters N (&rsquo;MaxClust&rsquo;).

criterion is used to choose the criterion for defining clusters, which
can be either "inconsistent" (default) or "distance". When using
"inconsistent", cluster compares the threshold value C to the
inconsistency coefficient of each link; when using "distance", cluster
compares the threshold value C to the height of each link.
D is the depth used to evaluate the inconsistency coefficient, its
default value is 2.

cluster uses "distance" as a criterion for defining new clusters when
it is used with the &rsquo;MaxClust&rsquo; method.

See also:
clusterdata,
dendrogram,
inconsistent,
kmeans,
linkage,
pdist


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Define clusters from an agglomerative hierarchical cluster tree.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 11
clusterdata


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 754
statistics: T = clusterdata ( X , cutoff )
statistics: T = clusterdata ( X , Name , Value )

Wrapper function for linkage and cluster .

If cutoff is used, then clusterdata calls linkage and
cluster with default value, using cutoff as a threshold value
for cluster . If cutoff is an integer and greater or equal to 2,
then cutoff is interpreted as the maximum number of cluster desired
and the "MaxClust" option is used for cluster .

If cutoff is not used, then clusterdata expects a list of pair
arguments. Then you must specify either the "Cutoff" or "MaxClust" option
for cluster . The method and metric used by linkage , are
defined through the "linkage" and "distance" arguments.

See also:
cluster,
dendrogram,
inconsistent,
kmeans,
linkage,
pdist


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 41
Wrapper function for linkage and cluster.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
cophenet


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1035
statistics: [ c , d ] = cophenet ( Z , y )

Compute the cophenetic correlation coefficient.

The cophenetic correlation coefficient C of a hierarchical cluster tree
Z is the linear correlation coefficient between the cophenetic
distances d and the euclidean distances y .
$$ c = \frac {\sum_{i
It is a measure of the similarity between the distance of the leaves, as seen
in the tree, and the distance of the original data points, which were used to
build the tree. When this similarity is greater, that is the coefficient is
closer to 1, the tree renders an accurate representation of the distances
between the original data points.

Z is a hierarchical cluster tree, as the output of linkage .
y is a vector of euclidean distances, as the output of pdist .

The optional output d is a vector of cophenetic distances, in the same
lower triangular format as y . The cophenetic distance between two data
points is the height of the lowest common node of the tree.

See also:
cluster,
dendrogram,
inconsistent,
linkage,
pdist,
squareform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Compute the cophenetic correlation coefficient.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
dbscan


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2955
statistics: idx = dbscan ( X , epsilon , minpts )
statistics: idx = dbscan ( D , epsilon , minpts , 'Distance' , 'precomputed' )
statistics: idx = dbscan (&hellip;, name , value )
statistics: [ idx , corepts ] = dbscan (&hellip;)

Density-Based Spatial Clustering of Applications with Noise (DBSCAN).

idx = dbscan ( X , epsilon , minpts ) partitions
the observations in the N&times;P numeric matrix X into clusters
using the DBSCAN algorithm with neighborhood radius epsilon and
minimum number of neighbors minpts . Rows of X correspond to
observations and columns correspond to features or variables. epsilon
must be a nonnegative scalar and minpts a positive integer scalar.
idx is an N&times;1 vector of cluster indices, numbered 1 to
the number of clusters found; observations flagged as noise are assigned the
value -1 .

A point is a core point when at least minpts observations
( including the point itself ) lie within distance epsilon of
it. Clusters grow from core points to every observation that is
density-reachable from them; a non-core observation that lies within
epsilon of a core point becomes a border point and joins that
point&rsquo;s cluster, while an observation that is neither core nor within reach
of a core point is labelled noise. A border point that is reachable from
more than one cluster is assigned to the first cluster that reaches it,
following the order of the observations in X .

idx = dbscan ( D , epsilon , minpts ,
'Distance' , 'precomputed' ) treats the N&times;N matrix
D as a precomputed matrix of pairwise distances between observations,
such as the output of pdist2 ; D (i,j) is the distance
between observations i and j .

[ idx , corepts ] = dbscan (&hellip;) also returns an
N&times;1 logical vector corepts that is true for each
observation that is a core point.

Additional parameters can be specified by Name-Value pair arguments.

Name Value
'Distance' is the distance metric used to find neighbors,
specified as one of the metrics accepted by rangesearch
( 'euclidean' by default, and also 'seuclidean' ,
'cityblock' , 'chebychev' , 'minkowski' ,
'mahalanobis' , 'cosine' , 'correlation' ,
'spearman' , 'hamming' , 'jaccard' , or a custom
distance function handle), or the string 'precomputed' to interpret
the first input as a matrix of pairwise distances.
'P' is the Minkowski distance exponent, a positive scalar.
This argument is only valid when the selected distance metric is
'minkowski' . By default it is 2.
'Scale' is the scale parameter for the standardized
Euclidean distance, a nonnegative numeric vector of length equal to the
number of columns in X . This argument is only valid when the selected
distance metric is 'seuclidean' .
'Cov' is the covariance matrix for the mahalanobis
distance, a positive definite matrix matching the number of columns in
X . This argument is only valid when the selected distance metric is
'mahalanobis' .

See also:
kmeans,
rangesearch,
pdist2,
knnsearch


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Density-Based Spatial Clustering of Applications with Noise (DBSCAN).



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
evalclusters


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3780
statistics: eva = evalclusters ( x , clust , criterion )
statistics: eva = evalclusters (&hellip;, Name , Value )

Create a clustering evaluation object to find the optimal number of clusters.

evalclusters creates a clustering evaluation object to evaluate the
optimal number of clusters for data x , using criterion criterion .
The input data x is a matrix with n observations of p
variables.
The evaluation criterion criterion is one of the following:

CalinskiHarabasz
to create a CalinskiHarabaszEvaluation object.
DaviesBouldin
to create a DaviesBouldinEvaluation object.
gap
to create a GapEvaluation object.
silhouette
to create a SilhouetteEvaluation object.

The clustering algorithm clust is one of the following:

kmeans
to cluster the data using kmeans with EmptyAction set to
singleton and Replicates set to 5.
linkage
to cluster the data using clusterdata with linkage set to
Ward .
gmdistribution
to cluster the data using fitgmdist with SharedCov set to
true and Replicates set to 5.

If the criterion is CalinskiHarabasz , DaviesBouldin , or
silhouette , clust can also be a function handle to a function
of the form c = clust(x, k) , where x is the input data,
k the number of clusters to evaluate and c the clustering result.
The clustering result can be either an array of size n with k
different integer values, or a matrix of size n by k with a
likelihood value assigned to each one of the n observations for each
one of the k clusters. In the latter case, each observation is assigned
to the cluster with the higher value. If the criterion is
CalinskiHarabasz , DaviesBouldin , or
silhouette , clust can also be a matrix of size n by
k , where k is the number of proposed clustering solutions, so
that each column of clust is a clustering solution.

In addition to the obligatory x , clust and criterion inputs
there is a number of optional arguments, specified as pairs of Name
and Value options. The known Name arguments are:

KList
a vector of positive integer numbers, that is the cluster sizes to evaluate.
This option is necessary, unless clust is a matrix of proposed
clustering solutions.
Distance
a distance metric as accepted by the chosen clust . It can be the
name of the distance metric as a string or a function handle. When
criterion is silhouette , it can be a vector as created by
function pdist . Valid distance metric strings are: sqEuclidean
(default), Euclidean , cityblock , cosine ,
correlation , Hamming , Jaccard .
Only used by silhouette and gap evaluation.
ClusterPriors
the prior probabilities of each cluster, which can be either empirical
(default), or equal . When empirical the silhouette value is
the average of the silhouette values of all points; when equal the
silhouette value is the average of the average silhouette value of each
cluster. Only used by silhouette evaluation.
B
the number of reference datasets generated from the reference distribution.
Only used by gap evaluation.
ReferenceDistribution
the reference distribution used to create the reference data. It can be
PCA (default) for a distribution based on the principal components of
X , or uniform for a uniform distribution based on the range of
the observed data. PCA is currently not implemented.
Only used by gap evaluation.
SearchMethod
the method for selecting the optimal value with a gap evaluation. It
can be either globalMaxSE (default) for selecting the smallest number
of clusters which is inside the standard error of the maximum gap value, or
firstMaxSE for selecting the first number of clusters which is inside
the standard error of the following cluster number.
Only used by gap evaluation.

Output eva is a clustering evaluation object.

See also:
CalinskiHarabaszEvaluation,
DaviesBouldinEvaluation,
GapEvaluation,
SilhouetteEvaluation


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 77
Create a clustering evaluation object to find the optimal number of clusters.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 9
fitgmdist


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2426
statistics: GMdist = fitgmdist ( data , k , param1 , value1 , &hellip;)

Fit a Gaussian mixture model with k components to data .
Each row of data is a data sample. Each column is a variable.

Optional parameters are:

'start' : Initialization conditions. Possible values are:

'randSample' (default) Takes means uniformly from rows of data.
'plus' Use k-means++ to initialize means.
'cluster' Performs an initial clustering with 10% of the data.
vector A vector whose length is the number of rows in data, and
whose values are 1 to k specify the components each row is initially
allocated to. The mean, variance, and weight of each component is calculated
from that.
structure A structure with fields mu , Sigma and
ComponentProportion .

For 'randSample' , 'plus' , and 'cluster' , the initial
variance of each component is the variance of the entire data sample.

'Replicates' : Number of random restarts to perform.
'RegularizationValue' or 'Regularize' : A small number
added to the diagonal entries of the covariance to prevent singular
covariances.
'SharedCovariance' or 'SharedCov' (logical). True if
all components must share the same variance, to reduce the number of free
parameters
'CovarianceType' or 'CovType' (string). Possible values
are:

'full' (default) Allow arbitrary covariance matrices.
'diagonal' Force covariances to be diagonal, to reduce the
number of free parameters.

'Options' : A structure with all of the following fields:

MaxIter Maximum number of EM iterations (default 100).
TolFun Threshold increase in likelihood to terminate EM
(default 1e-6).
Display Possible values are:

'off' (default): Display nothing.
'final' : Display the total number of iterations and likelihood
once the execution completes.
'iter' : Display the number of iteration and likelihood after
each iteration.

'Weight' : A column vector or N&times;2 matrix. The first
column consists of non-negative weights given to the samples. If these are
all integers, this is equivalent to specifying weight (i) copies
of row i of data , but potentially faster. If a row of
data is used to represent samples that are similar but not identical,
then the second column of weight indicates the variance of those
original samples. Specifically, in the EM algorithm, the contribution of row
i towards the variance is set to at least weight (i,2) ,
to prevent spurious components with zero variance.

See also:
gmdistribution,
kmeans


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Fit a Gaussian mixture model with k components to data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 14
gmdistribution


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1083
statistics: GMdist = gmdistribution ( mu , Sigma )
statistics: GMdist = gmdistribution ( mu , Sigma , p )
statistics: GMdist = gmdistribution ( mu , Sigma , p , extra )

Create an object of the gmdistribution class which represents a Gaussian
mixture model with k components of n-dimensional Gaussians.

Input mu is a k-by-n matrix specifying the n-dimensional mean of
each of the k components of the distribution.

Input Sigma is an array that specifies the variances of the
distributions, in one of four forms depending on its dimension.

n-by-n-by-k: Slice Sigma (:,:,i) is the variance of the
i&rsquo;th component
1-by-n-by-k: Slice diag( Sigma (1,:,i)) is the variance of the
i&rsquo;th component
n-by-n: Sigma is the variance of every component
1-by-n-by-k: Slice diag( Sigma ) is the variance of every
component

If p is specified, it is a vector of length k specifying the
proportion of each component. If it is omitted or empty, each component
has an equal proportion.

Input extra is used by fitgmdist to indicate the parameters of the
fitting process.

See also:
fitgmdist


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 132
Create an object of the gmdistribution class which represents a Gaussian mixture model with k components of n-dimensional Gaussians.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
gmdistribution.AIC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 230
gmdistribution: property AIC

Akaike information criterion

A scalar, twice the negative log-likelihood plus twice the number of
estimated parameters. It is empty unless the object came from
fitgmdist . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Akaike information criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
gmdistribution.BIC


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 270
gmdistribution: property BIC

Bayesian information criterion

A scalar, twice the negative log-likelihood plus the number of
estimated parameters times the log of the number of observations.
It is empty unless the object came from fitgmdist . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 30
Bayesian information criterion



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
gmdistribution.ComponentProportion


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 234
gmdistribution: property ComponentProportion

Mixing proportions

A 1-by-k row vector holding the proportion of each component. The
proportions are scaled to sum to 1, and are all equal when none was
given. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
Mixing proportions



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
gmdistribution.Converged


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 228
gmdistribution: property Converged

Whether the fit converged

A logical scalar, true when the fit reached its tolerance within the
iteration limit. It is empty unless the object came from
fitgmdist . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 25
Whether the fit converged



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
gmdistribution.CovarianceType


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 229
gmdistribution: property CovarianceType

Form of the component covariances

A character vector, 'diagonal' when each covariance was
given as a row of variances and 'full' when it was given as
a matrix. This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 33
Form of the component covariances



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
gmdistribution.DistributionName


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 151
gmdistribution: property DistributionName

Name of the distribution

The character vector 'gaussian mixture distribution' . This
property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
Name of the distribution



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 36
gmdistribution.NegativeLogLikelihood


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 246
gmdistribution: property NegativeLogLikelihood

Negative log-likelihood at the fit

A scalar, the negative of the log-likelihood of the data under the
fitted mixture. It is empty unless the object came from
fitgmdist . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
Negative log-likelihood at the fit



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
gmdistribution.NumComponents


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 144
gmdistribution: property NumComponents

Number of mixture components

A positive integer, the number of rows of mu . This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
Number of mixture components



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 28
gmdistribution.NumIterations


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 164
gmdistribution: property NumIterations

Iterations the fit took

A positive integer. It is empty unless the object came from
fitgmdist . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 23
Iterations the fit took



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 27
gmdistribution.NumVariables


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 179
gmdistribution: property NumVariables

Number of variables

A positive integer, the dimension of each component, which is the
number of columns of mu . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 19
Number of variables



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 34
gmdistribution.RegularizationValue


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 266
gmdistribution: property RegularizationValue

Regularization added to the covariance diagonal

A nonnegative scalar added to the diagonal of each covariance to
keep it positive definite. It is empty unless the object came from
fitgmdist . This property is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Regularization added to the covariance diagonal



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 31
gmdistribution.SharedCovariance


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 237
gmdistribution: property SharedCovariance

Whether the components share one covariance

A logical scalar, true when a single covariance was given for every
component and false when one was given per component. This property
is read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 43
Whether the components share one covariance



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
gmdistribution.Sigma


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 325
gmdistribution: property Sigma

Component covariances

The covariances of the components, in the form they were given in.
A full covariance per component is d-by-d-by-k, a diagonal one per
component 1-by-d-by-k, a full covariance shared by every component
d-by-d, and a shared diagonal one 1-by-d. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
Component covariances



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
gmdistribution.cdf


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 455
gmdistribution: c = cdf ( obj , X )

Cumulative distribution function of a Gaussian mixture distribution.

X is an n-by-d matrix of points at which the distribution is
evaluated, one point per row, where d is the number of variables of
obj . c is an n-by-1 vector holding the value of the
cumulative distribution function at each of them, the components&rsquo;
cumulative distributions summed with the mixing proportions in
ComponentProportion as weights.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 68
Cumulative distribution function of a Gaussian mixture distribution.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 22
gmdistribution.cluster


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 905
gmdistribution: idx = cluster ( obj , X )
gmdistribution: [ idx , nlogl ] = cluster ( obj , X )
gmdistribution: [ idx , nlogl , P ] = cluster ( obj , X )
gmdistribution: [ idx , nlogl , P , logpdf ] = cluster ( obj , X )
gmdistribution: [ idx , nlogl , P , logpdf , M ] = cluster ( obj , X )

Assign each observation to a mixture component.

X is an n-by-d matrix of observations, one per row, where d is
the number of variables of obj . Each is assigned to the
component under which it is most probable.

idx is an n-by-1 vector of component indices. nlogl is
the negative log-likelihood of X under the mixture. P is
an n-by-k matrix of posterior probabilities, one column per component,
whose rows sum to one. logpdf is an n-by-1 vector holding the
logarithm of the mixture density at each observation. M is an
n-by-k matrix of squared Mahalanobis distances from each observation
to each component mean.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 47
Assign each observation to a mixture component.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
gmdistribution.fit


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 402
gmdistribution: obj = fit ( X , k )
gmdistribution: obj = fit ( X , k , Name , Value )

Fit a Gaussian mixture distribution to data.

X is an n-by-d matrix of observations, one per row, and k
is the number of components to fit. Any Name - Value pair
accepted by fitgmdist may follow, which is the function this
method calls and where the options are documented. obj is the
fitted gmdistribution object.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 44
Fit a Gaussian mixture distribution to data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 29
gmdistribution.gmdistribution


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1025
gmdistribution: obj = gmdistribution ( mu , Sigma )
gmdistribution: obj = gmdistribution ( mu , Sigma , p )
gmdistribution: obj = gmdistribution ( mu , Sigma , p , extra )

Create a Gaussian mixture distribution.

mu is a k-by-d matrix holding the mean of each of the k
components, one per row, where d is the number of variables.

Sigma holds the covariances in one of four forms. A full
covariance per component is d-by-d-by-k and a diagonal one per
component is 1-by-d-by-k, while a single d-by-d matrix or a single
1-by-d row of variances is shared by every component. The form given
sets CovarianceType and SharedCovariance .

p is a vector of k mixing proportions, scaled to sum to 1. A
proportion may not be negative and they may not all be zero. When
p is omitted or empty the components are equally weighted.

extra carries the results of a fit and is passed by
fitgmdist . It fills AIC , BIC ,
Converged , NegativeLogLikelihood ,
NumIterations and RegularizationValue , which stay
empty for an object built by hand.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 39
Create a Gaussian mixture distribution.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 20
gmdistribution.mahal


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 377
gmdistribution: D = mahal ( obj , X )

Squared Mahalanobis distance to each mixture component.

X is an n-by-d matrix of observations, one per row, where d is
the number of variables of obj . D is an n-by-k matrix
holding the squared Mahalanobis distance from each observation to the
mean of each of the k components, measured in the covariance of the
component it is taken to.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 55
Squared Mahalanobis distance to each mixture component.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 17
gmdistribution.mu


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 184
gmdistribution: property mu

Component means

A k-by-d matrix holding the mean of each of the k components, one
per row, where d is the number of variables. This property is
read-only.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
Component means



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 18
gmdistribution.pdf


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 393
gmdistribution: c = pdf ( obj , X )

Probability density function of a Gaussian mixture distribution.

X is an n-by-d matrix of points at which the density is
evaluated, one point per row, where d is the number of variables of
obj . c is an n-by-1 vector holding the density at each of
them, the components&rsquo; densities summed with the mixing proportions in
ComponentProportion as weights.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 64
Probability density function of a Gaussian mixture distribution.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 24
gmdistribution.posterior


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 320
gmdistribution: c = posterior ( obj , X )

Posterior probability of each mixture component.

X is an n-by-d matrix of observations, one per row, where d is
the number of variables of obj . c is an n-by-k matrix
whose (i,j) element is the probability that observation i was drawn
from component j, so its rows sum to one.


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 48
Posterior probability of each mixture component.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 21
gmdistribution.random


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 368
gmdistribution: c = random ( obj )
gmdistribution: c = random ( obj , n )

Random numbers from a Gaussian mixture distribution.

n is the number of observations to draw and defaults to 1.
c is an n -by-d matrix holding one observation per row,
where d is the number of variables of obj . Each row is drawn
from a component chosen with probability ComponentProportion .


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Random numbers from a Gaussian mixture distribution.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 12
inconsistent


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 955
statistics: Y = inconsistent ( Z )
statistics: Y = inconsistent ( Z , d )

Compute the inconsistency coefficient for each link of a hierarchical cluster
tree.

Given a hierarchical cluster tree Z generated by the linkage
function, inconsistent computes the inconsistency coefficient for each
link of the tree, using all the links down to the d -th level below that
link.

The default depth d is 2, which means that only two levels are
considered: the level of the computed link and the level below that.

Each row of Y corresponds to the row of same index of Z .
The columns of Y are respectively: the mean of the heights of the links
used for the calculation, the standard deviation of the heights of those
links, the number of links used, the inconsistency coefficient.

Reference
Jain, A., and R. Dubes. Algorithms for Clustering Data.
Upper Saddle River, NJ: Prentice-Hall, 1988.

See also:
cluster,
clusterdata,
dendrogram,
linkage,
pdist,
squareform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 83
Compute the inconsistency coefficient for each link of a hierarchical cluster tree.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 6
kmeans


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 4586
statistics: idx = kmeans ( data , k )
statistics: [ idx , centers ] = kmeans ( data , k )
statistics: [ idx , centers , sumd ] = kmeans ( data , k )
statistics: [ idx , centers , sumd , dist ] = kmeans ( data , k )
statistics: [&hellip;] = kmeans ( data , k , param1 , value1 , &hellip;)
statistics: [&hellip;] = kmeans ( data , [], 'start' , start , &hellip;)

Perform a k -means clustering of the N&times;D matrix data .

If parameter 'start' is specified, then k may be empty
in which case k is set to the number of rows of start .

The outputs are:

idx An N&times;1 vector whose i -th element is
the class to which row i of data is assigned.
centers A K&times;D array whose i -th row is the
centroid of cluster i .
sumd A k&times;1 vector whose i -th entry is the
sum of the distances from samples in cluster i to centroid i .
dist An N&times;k matrix whose i j -th
element is the distance from sample i to centroid j .

The following parameters may be placed in any order. Each parameter
must be followed by its value, as in Name-Value pairs.

Name Description
'Start' The initialization method for the centroids.

Value Description
'plus' The k-means++ algorithm. (Default)
'sample' A subset of k rows from
data , sampled uniformly without replacement.
'cluster' Perform a pilot clustering on 10% of
the rows of data .
'uniform' Each component of each centroid is
drawn uniformly from the interval between the maximum and minimum values of
that component within data . This performs poorly and is implemented
only for Matlab compatibility.
numeric matrix A k&times;D matrix of centroid
starting locations. The rows correspond to seeds.
numeric array A k&times;D&times;r array of centroid
starting locations. The third dimension invokes replication of the
clustering routine. Page r contains the set of seeds for replicate
r . kmeans infers the number of replicates (specified by the
'Replicates' Name-Value pair argument) from the size of the third
dimension.

Name Description
'Distance' The distance measure used for partitioning
and calculating centroids.

Value Description
'sqeuclidean' The squared Euclidean distance.
i.e. the sum of the squares of the differences between corresponding
components. In this case, the centroid is the arithmetic mean of all samples
in its cluster. This is the only distance for which this algorithm is truly
"k-means".
'cityblock' The sum metric, or L1 distance,
i.e. the sum of the absolute differences between corresponding components.
In this case, the centroid is the median of all samples in its cluster.
This gives the k-medians algorithm.
'cosine' One minus the cosine of the included
angle between points (treated as vectors). Each centroid is the mean of the
points in that cluster, after normalizing those points to unit Euclidean
length.
'correlation' One minus the sample correlation
between points (treated as sequences of values). Each centroid is the
component-wise mean of the points in that cluster, after centering and
normalizing those points to zero mean and unit standard deviation.
'hamming' The number of components in which the
sample and the centroid differ. In this case, the centroid is the median of
all samples in its cluster. Unlike Matlab, Octave allows non-logical
data .

Name Description
'EmptyAction' What to do when a centroid is not the
closest to any data sample.

Value Description
'error' Throw an error.
'singleton' (Default) Select the row of
data that has the highest error and use that as the new centroid.
'drop' Remove the centroid, and continue
computation with one fewer centroid. The dimensions of the outputs
centroids and d are unchanged, with values for omitted centroids
replaced by NaN.

Name Description
'Display' Display a text summary.

Value Description
'off' (Default) Display no summary.
'final' Display a summary for each clustering
operation.
'iter' Display a summary for each iteration of a
clustering operation.

Name Value
'Replicates' A positive integer specifying the number
of independent clusterings to perform. The output values are the values for
the best clustering, i.e., the one with the smallest value of sumd .
If Start is numeric, then Replicates defaults to
(and must equal) the size of the third dimension of Start .
Otherwise it defaults to 1.
'MaxIter' The maximum number of iterations to perform
for each replicate. If the maximum change of any centroid is less than
0.001, then the replicate terminates even if MaxIter iterations have no
occurred. The default is 100.

Example:

[~,c] = kmeans (rand(10, 3), 2, "emptyaction", "singleton");

See also:
linkage


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 52
Perform a k-means clustering of the N*D matrix data.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 8
kmedoids


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2926
statistics: idx = kmedoids ( X , k )
statistics: [ idx , C ] = kmedoids ( X , k )
statistics: [ idx , C , sumd ] = kmedoids ( X , k )
statistics: [ idx , C , sumd , D ] = kmedoids ( X , k )
statistics: [ idx , C , sumd , D , midx ] = kmedoids ( X , k )
statistics: [ idx , C , sumd , D , midx , info ] = kmedoids ( X , k )
statistics: [&hellip;] = kmedoids (&hellip;, name , value )

Partition observations into k clusters using the k-medoids algorithm.

idx = kmedoids ( X , k ) partitions the N&times;P
numeric matrix X into k clusters, each represented by one of the
observations (its medoid ), and returns the N&times;1 vector
idx of cluster indices. Rows of X correspond to observations and
columns correspond to features or variables. Unlike kmeans , whose
centroids are the mean of each cluster, a medoid is an actual data point,
which makes k-medoids more robust to outliers and applicable to any distance
metric.

[ idx , C , sumd , D , midx , info ] =
kmedoids (&hellip;) returns additional results:

C a k&times;P matrix with the coordinates of the k
medoids, one per row ( C = X ( midx ,:) ).
sumd a k&times;1 vector with the within-cluster sum of the
distances from each point to its cluster medoid, measured with the selected
metric.
D an N&times;k matrix with the distance from every
observation to every medoid.
midx a k&times;1 vector with the row indices into X
of the k medoids.
info a scalar structure with the fields 'algorithm' ,
'start' , 'distance' , 'iterations' , and
'bestReplicate' describing the chosen run.

Additional parameters can be specified by Name-Value pair arguments.

Name Value
'Distance' the distance metric, one of
'sqeuclidean' (default), 'euclidean' , 'seuclidean' ,
'cityblock' , 'minkowski' , 'chebychev' ,
'cosine' , 'correlation' , 'hamming' ,
'jaccard' , 'spearman' , 'mahalanobis' , or a custom
distance function handle accepted by pdist2 .
'Algorithm' the optimization algorithm, either
'pam' (default) for Partitioning Around Medoids, which searches over
all medoid/non-medoid swaps, or 'small' for the faster Voronoi
iteration that reassigns points and re-selects each cluster medoid until
convergence.
'Start' the method used to choose the initial medoids:
'plus' (default, k-means++), 'sample' (a random subset of the
observations), 'cluster' (a preliminary pass on a subsample), or a
k&times;P numeric matrix of starting medoid locations, each snapped to the
nearest observation. A k&times;P&times;R array supplies a separate start for each
of R replicates.
'Replicates' a positive integer number of times to repeat
the clustering, each with a new set of initial medoids; the solution with the
lowest total sum of distances is returned. The default is 1, or the size of
the third dimension of a numeric 'Start' .
'Options' a structure, as created by statset , whose
'MaxIter' field caps the number of iterations (default 100).

See also:
kmeans,
linkage,
pdist2,
dbscan


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 69
Partition observations into k clusters using the k-medoids algorithm.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 7
linkage


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 3290
statistics: y = linkage ( d )
statistics: y = linkage ( d , method )
statistics: y = linkage ( x )
statistics: y = linkage ( x , method )
statistics: y = linkage ( x , method , metric )
statistics: y = linkage ( x , method , arglist )

Produce a hierarchical clustering dendrogram.

d is the dissimilarity matrix relative to n observations,
formatted as a (n-1)&times;n/2 x1 vector as produced by pdist .
Alternatively, x contains data formatted for input to
pdist , metric is a metric for pdist and
arglist is a cell array containing arguments that are passed to
pdist .

linkage starts by putting each observation into a singleton
cluster and numbering those from 1 to n. Then it merges two
clusters, chosen according to method , to create a new cluster
numbered n+1, and so on until all observations are grouped into
a single cluster numbered 2(n-1). Row k of the
(m-1)x3 output matrix relates to cluster n+k: the first
two columns are the numbers of the two component clusters and column
3 contains their distance.

When several pairs of clusters are equally close, which of them is merged
first is not determined by the data, and the cluster numbers in the first two
columns are therefore implementation-defined. Only column 3, the sequence of
merge distances, is reproducible across implementations, and even that is so
only for the methods whose recomputation rule does not depend on the merge
order ( "weighted" , "centroid" and "median" do depend
on it). Code that must be portable should read column 3, or the cluster
assignment obtained from cluster , rather than the raw numbering.

method defines the way the distance between two clusters is
computed and how they are recomputed when two clusters are merged:

&lsquo; "single" (default) &rsquo;
Distance between two clusters is the minimum distance between two
elements belonging each to one cluster. Produces a cluster tree
known as minimum spanning tree.
&lsquo; "complete" &rsquo;
Furthest distance between two elements belonging each to one cluster.
&lsquo; "average" &rsquo;
Unweighted pair group method with averaging (UPGMA).
The mean distance between all pair of elements each belonging to one
cluster.
&lsquo; "weighted" &rsquo;
Weighted pair group method with averaging (WPGMA).
When two clusters A and B are joined together, the new distance to a
cluster C is the mean between distances A-C and B-C.
&lsquo; "centroid" &rsquo;
Unweighted Pair-Group Method using Centroids (UPGMC).
Assumes Euclidean metric. The distance between cluster centroids,
each centroid being the center of mass of a cluster.
&lsquo; "median" &rsquo;
Weighted pair-group method using centroids (WPGMC).
Assumes Euclidean metric. Distance between cluster centroids. When
two clusters are joined together, the new centroid is the midpoint
between the joined centroids.
&lsquo; "ward" &rsquo;
Ward&rsquo;s sum of squared deviations about the group mean (ESS).
Also known as minimum variance or inner squared distance.
Assumes Euclidean metric. How much the moment of inertia of the
merged cluster exceeds the sum of those of the individual clusters.

Reference
Ward, J. H. Hierarchical Grouping to Optimize an Objective Function
J. Am. Statist. Assoc. 1963, 58, 236-244,
http://iv.slis.indiana.edu/sw/data/ward.pdf .

See also:
pdist,
squareform


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 45
Produce a hierarchical clustering dendrogram.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 16
optimalleaforder


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 1222
statistics: leafOrder = optimalleaforder ( tree , D )
statistics: leafOrder = optimalleaforder (&hellip;, Name , Value )

Compute the optimal leaf ordering of a hierarchical binary cluster tree.

The optimal leaf ordering of a tree is the ordering which minimizes the sum
of the distances between each leaf and its adjacent leaves, without altering
the structure of the tree, that is without redefining the clusters of the
tree.

Required inputs:

tree : a hierarchical cluster tree tree generated by the
linkage function.

D : a matrix of distances as computed by pdist .

Optional inputs can be the following property/value pairs:

property &rsquo;Criteria&rsquo; at the moment can only have the value &rsquo;adjacent&rsquo;,
for minimizing the distances between leaves.

property &rsquo;Transformation&rsquo; can have one of the values &rsquo;linear&rsquo;, &rsquo;inverse&rsquo;
or a handle to a custom function which computes S the similarity
matrix.

optimalleaforder&rsquo;s output leafOrder is the optimal leaf ordering.

Reference
Bar-Joseph, Z., Gifford, D.K., and Jaakkola, T.S. Fast optimal leaf ordering
for hierarchical clustering. Bioinformatics vol. 17 suppl. 1, 2001.

See also:
dendrogram,
linkage,
pdist


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 72
Compute the optimal leaf ordering of a hierarchical binary cluster tree.



# name: <cell-element>
# type: sq_string
# elements: 1
# length: 15
spectralcluster


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 2819
statistics: idx = spectralcluster ( X , k )
statistics: idx = spectralcluster ( S , k , 'Distance' , 'precomputed' )
statistics: [ idx , V ] = spectralcluster (&hellip;)
statistics: [ idx , V , D ] = spectralcluster (&hellip;)
statistics: [&hellip;] = spectralcluster (&hellip;, name , value )

Partition observations into k clusters using spectral clustering.

idx = spectralcluster ( X , k ) partitions the
N&times;P numeric matrix X into k clusters and returns the
N&times;1 vector idx of cluster indices. Rows of X correspond
to observations and columns to features. Spectral clustering builds a
similarity graph over the observations, embeds them with the eigenvectors of
the graph Laplacian, and clusters that embedding, which lets it recover
clusters that are not linearly separable in the original space.

[ idx , V , D ] = spectralcluster (&hellip;) also returns
the N&times;k matrix V whose columns are the eigenvectors associated
with the k smallest eigenvalues of the Laplacian, and the k&times;1
vector D of those eigenvalues. The signs of the eigenvectors, and the
basis within a repeated eigenvalue, are arbitrary.

Additional parameters can be specified by Name-Value pair arguments.

Name Value
'Distance' the distance metric used to build the
similarity graph, one of 'euclidean' (default), 'seuclidean' ,
'mahalanobis' , 'cityblock' , 'minkowski' ,
'chebychev' , 'cosine' , 'correlation' ,
'hamming' , 'jaccard' , 'spearman' , or a function
handle accepted by pdist2 , or the string 'precomputed' to
interpret the first input as an N&times;N similarity matrix.
'SimilarityGraph' 'knn' (default) to connect each
observation to its nearest neighbors, or 'epsilon' to connect
observations that are within a fixed radius.
'NumNeighbors' the number of nearest neighbors for the
'knn' graph, a positive integer. The default is
ceil (log ( N )) .
'KNNGraphType' 'complete' (default) to connect
i and j when either is a nearest neighbor of the other, or
'mutual' to connect them only when each is a nearest neighbor of the
other.
'Radius' the radius for the 'epsilon' graph, a
nonnegative scalar. Required when 'SimilarityGraph' is
'epsilon' .
'KernelScale' the positive scale factor sigma in
the Gaussian similarity kernel exp (-(dist / sigma)^2) applied to the
graph edges. The default is 1.
'LaplacianNormalization' 'randomwalk' (default),
'symmetric' , or 'none' , selecting how the graph Laplacian is
normalized before the eigendecomposition.
'ClusterMethod' 'kmeans' (default) or
'kmedoids' to cluster the eigenvector embedding.
'P' the Minkowski exponent (default 2), used only with the
'minkowski' distance.
'Cov' the covariance matrix used only with the
'mahalanobis' distance.
'Scale' the scaling vector used only with the
'seuclidean' distance.

See also:
kmeans,
kmedoids,
dbscan,
linkage,
pdist2


# name: <cell-element>
# type: sq_string
# elements: 1
# length: 65
Partition observations into k clusters using spectral clustering.





