ClusterData_KMeans
Clusters data using KMeans algorithm.
Syntax
C++
C#
Python
def ClusterData_KMeans( inData: list[ list[float] ], inClusteringMethod: KMeansClusteringMethod, outCentroids: Matrix, /, *, inClusters: int = 2, inMaxIterations: int = 200, inSeed: int = 5489, inTerminationFactor: float = 1.5 ) -> ( outPointToClusterAssignment: list[int], outDistanceSum: float )
Parameters
| Name | Type | Range | Default | Description | |
|---|---|---|---|---|---|
![]() |
inData | list[ list[float] ] | Data set, array of examples | ||
![]() |
inClusters | int | 2 - +![]() |
2 | Number of clusters to extract |
![]() |
inMaxIterations | int | 10 - 1000 | 200 | Maximal number of procedure iterations |
![]() |
inSeed | int | 0 - ![]() |
5489 | Seed to init random engine |
![]() |
inTerminationFactor | float | 1.0 - 2.0 | 1.5 | Additional factor of procedure stop |
![]() |
inClusteringMethod | KMeansClusteringMethod | KMeans variant to use | ||
![]() |
outCentroids | Matrix | Resulting centroid points in feature space | ||
![]() |
outPointToClusterAssignment | list[int] | Array of input point assignments to generated clusters | ||
![]() |
outDistanceSum | float | Sum of squared distances from points to its respective cluster centroids |



