ILNumerics - Technical Application Development
Assembly: ILNumerics.Toolboxes.MachineLearning (in ILNumerics.Toolboxes.MachineLearning.dll) Version: 5.5.0.0 (5.5.7503.3146)
Vector of length n with indices of the clusters which were assigned to each datapoint.
k-means clustering: finds clusters in data matrix X.
[ILNumerics Machine Learning Toolbox]
Namespace: ILNumerics.Toolboxes
Assembly: ILNumerics.Toolboxes.MachineLearning (in ILNumerics.Toolboxes.MachineLearning.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax
public static RetArray<long> kMeansClust( InArray<double> X, BaseArray k, int maxIterations = 10000, bool centerInitRandom = true, OutArray<double> outCenters = null )
Parameters
- X
- Type: ILNumericsInArrayDouble
Data matrix, data points are given as columns. - k
- Type: ILNumericsBaseArray
Initial number of clusters. - maxIterations (Optional)
- Type: SystemInt32
[Optional] Maximum number of iterations, the computation will exit after that many iterations, default: 10.000. - centerInitRandom (Optional)
- Type: SystemBoolean
[Optional] false: pick the first k data points as initial centers, true: pick random datapoints (default). - outCenters (Optional)
- Type: ILNumericsOutArrayDouble
[Input/Output/Optional] If not null on entry, outCenters will contain the centers of the clusters found, default: null.
Return Value
Type: RetArrayInt64Vector of length n with indices of the clusters which were assigned to each datapoint.
Remarks
If outCenters is given not null on input, the algorithm returns the computed centers in that parameter. A matrix may be given on input, in order to give a hint of the initial center positions. This may help to find correct cluster centers - even if the initial hint is not exact. In order to do so, the matrix given must be of the correct size (X.D[0] by k) and centerInitRandom must be set to false.
[ILNumerics Machine Learning Toolbox]
See Also