Clusters the data into the specified number of clusters.

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

Syntax

C#
public ClusterSet Cluster(
	DoubleMatrix centers
)
Visual Basic (Declaration)
Public Function Cluster ( _
	centers As DoubleMatrix _
) As ClusterSet
Visual C++
public:
ClusterSet^ Cluster(
	DoubleMatrix^ centers
)

Parameters

centers
Type: CenterSpace.NMath.Core..::.DoubleMatrix
A matrix of initial cluster centers. K is inferred from the number of rows in the matrix.

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 the number of cluster centers is less than one or greater than the number of data points (this.N), or if the dimensionality of the centers is not equal to the dimensionality of the data points.
CenterSpace.NMath.Core..::.NMathException Thrown if an empty cluster is encountered. Re-cluster with different starting centers.

See Also