KMeans |
The KMeansClustering type exposes the following members.
| Name | Description | |
|---|---|---|
| KMeansClustering | Constructs an empty KMeansClustering instance. | |
| KMeansClustering(DataFrame) | Constructs a KMeansClustering instance from the given data. | |
| KMeansClustering(DoubleMatrix) | Constructs a KMeansClustering instance from the given data. | |
| KMeansClustering(DataFrame, Int32) | Constructs a KMeansClustering instance from the given data and the specified maximum number of iterations. | |
| KMeansClustering(DoubleMatrix, Int32) | Constructs a KMeansClustering instance from the given data and the specified maximum number of iterations. |
| Name | Description | |
|---|---|---|
| Clusters | Gets the cluster assignments computed during the last clustering. | |
| Data | Gets and sets the data matrix. | |
| DefaultMaxIterations | Gets and sets the default maximum number of iterations. | |
| FinalCenters | Gets the matrix of final cluster centers computed during the last clustering. | |
| InitialCenters | Gets the matrix of initial cluster centers used during the last clustering. | |
| Iterations | Gets the number of iterations used in the clustering just computed. | |
| K | Gets the number of clusters computed during the last clustering.. | |
| MaxIterations | Gets and sets the maximum number of iterations used in clustering. | |
| MaxIterationsMet | Returns true if the clustering just computed stopped because the maximum number of iterations was reached; otherwise, false. | |
| N | Gets the number of objects in this.Data. | |
| Sizes | Gets the number of points in each cluster computed during the last clustering. | |
| WithinSumOfSquares | Gets the within-cluster sum of squares for each cluster computed during the last clustering. |
| Name | Description | |
|---|---|---|
| Clone | Creates a deep copy of this cluster analysis. | |
| Cluster(DoubleMatrix) | Clusters the data into the specified number of clusters. | |
| Cluster(Int32) | Clusters the data into the specified number of clusters. | |
| Cluster(Int32, KMeansClusteringStart) | Clusters the data into the specified number of clusters, using the specified method of choosing the initial cluster centers. | |
| Cluster(Int32, RandGenMTwist) | Clusters the data into the specified number of clusters. |
| Name | Description | |
|---|---|---|
| clusters_ | The cluster assigments. | |
| data_ | A matrix of data. Each row in the matrix represents an object to be clustered. | |
| DEFAULT_MAX_ITER | The default maximum number of iterations. | |
| finalCenters_ | A matrix of final cluster centers. | |
| initialCenters_ | A matrix of initial cluster centers. | |
| iter_ | The number of iterations performed. | |
| max_ | The maximum number of iterations. | |
| sizes_ | The number of objects in each cluster. | |
| withinss_ | The within-cluster sum of squares for each cluster. |
// cluster 8 random vectors of length 3 DoubleMatrix data = new DoubleMatrix( 8, 3, new RandGenUniform() ); KMeansClustering cl = new KMeansClustering( data ); // create 3 clusters, using random starting cluster centers ClusterSet clusters = cl.Cluster( 3 );