Clusters the data into the specified number of clusters, using the specified method of choosing the initial cluster centers.

Namespace:  CenterSpace.NMath.Stats
Assembly:  NMathStats (in NMathStats.dll) Version: 3.4.0.0

Syntax

C#
public ClusterSet Cluster(
	int k,
	KMeansClustering..::.Start start
)
Visual Basic (Declaration)
Public Function Cluster ( _
	k As Integer, _
	start As KMeansClustering..::.Start _
) As ClusterSet
Visual C++
public:
ClusterSet^ Cluster(
	int k, 
	KMeansClustering..::.Start start
)

Parameters

k
Type: System..::.Int32
The number of clusters to form.
start
Type: CenterSpace.NMath.Stats..::.KMeansClustering..::.Start
The method to use for choosing the initial cluster centers.

Return Value

A ClusterSet that identifies the cluster into which each object was grouped. Cluster numbers are based on row indices in this.Data and this.Centers.

Exceptions

ExceptionCondition
CenterSpace.NMath.Core..::.InvalidArgumentException Thrown if k is less than one or greater than the number of objects (this.N).
CenterSpace.NMath.Core..::.NMathException Thrown if an empty cluster is encountered. Re-cluster with different starting centers.

See Also