Class KMeans.Result

java.lang.Object
edu.cmu.tetrad.search.unmix.KMeans.Result
Enclosing class:
KMeans

public static class KMeans.Result extends Object
Represents the result of a clustering operation using the KMeans algorithm. The result includes the assignments of data points to clusters (labels) and the centroids of the clusters.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double[][]
    A 2-dimensional array representing the centroids of clusters computed by the KMeans algorithm.
    final int[]
    An array representing the cluster assignments for each data point after the KMeans clustering operation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Result(int[] labels, double[][] centroids)
    Constructs a Result object containing the clustering assignments of data points to clusters and the centroids of the clusters computed by a clustering algorithm.
  • Method Summary

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • labels

      public final int[] labels
      An array representing the cluster assignments for each data point after the KMeans clustering operation. Each entry in the array corresponds to a specific data point, and its value indicates the index of the cluster to which the data point belongs.
    • centroids

      public final double[][] centroids
      A 2-dimensional array representing the centroids of clusters computed by the KMeans algorithm. Each row in the array corresponds to a cluster centroid, and each column represents one of the dimensions of the feature space. The values in the array are the coordinates of the centroids in the feature space.
  • Constructor Details

    • Result

      public Result(int[] labels, double[][] centroids)
      Constructs a Result object containing the clustering assignments of data points to clusters and the centroids of the clusters computed by a clustering algorithm.
      Parameters:
      labels - An array representing the cluster assignments for each data point. Each element in the array corresponds to a specific data point and indicates the index of the cluster to which the data point was assigned.
      centroids - A 2-dimensional array representing the coordinates of the cluster centroids. Each row in the array corresponds to a cluster centroid, and each column represents a dimension in the feature space.