You are here: Start » AVL.NET » Function Reference » Data Classification » Clustering » AVL.ClusterData_KMeans

AVL.ClusterData_KMeans

Clusters data using KMeans algorithm.

Namespace:AvlNet
Assembly:AVL.NET.dll

Syntax

C++
C#
 
public static void ClusterData_KMeans
(
	IList<IList<float>> inData,
	int inClusters,
	int inMaxIterations,
	int inSeed,
	float inTerminationFactor,
	AvlNet.KMeansClusteringMethod inClusteringMethod,
	AvlNet.Matrix outCentroids,
	IList<int> outPointToClusterAssignment,
	out float outDistanceSum
)

Parameters

Name Type Range Default Description
inDataSystem.Collections.Generic.IList<System.Collections.Generic.IList<float>>Data set, array of examples.
inClustersint<2, +INF>2Number of clusters to extract. Default value: 2.
inMaxIterationsint<10, 1000>200Maximal number of procedure iterations. Default value: 200.
inSeedint<0, INF>5489Seed to init random engine. Default value: 5489.
inTerminationFactorfloat<1.0f, 2.0f>1.5fAdditional factor of procedure stop. Default value: 1.5f.
inClusteringMethodAvlNet.KMeansClusteringMethodKMeansPlusPlusKMeans variant to use. Default value: KMeansPlusPlus.
outCentroidsAvlNet.MatrixResulting centroid points in feature space.
outPointToClusterAssignmentSystem.Collections.Generic.IList<int>Array of input point assignments to generated clusters.
outDistanceSumfloatSum of squared distances from points to its respective cluster centroids.

Errors

List of possible exceptions:

Error type Description
DomainError Cannot make more clusters than there is data in input dataset in ClusterData_KMeans.
DomainError Empty dataset on input in ClusterData_KMeans.
DomainError Inconsistent number of data coordinates in input dataset in ClusterData_KMeans.

See also