Class Clustering

  • All Implemented Interfaces:
    java.io.Serializable

    public class Clustering
    extends java.lang.Object
    implements java.io.Serializable
    See Also:
    Serialized Form
    • Field Detail

      • numLabels

        protected int numLabels
      • labels

        protected int[] labels
    • Constructor Detail

      • Clustering

        public Clustering​(InstanceList instances,
                          int numLabels,
                          int[] labels)
        Clustering constructor.
        Parameters:
        instances - Instances that are clustered
        numLabels - Number of clusters
        labels - Assignment of instances to clusters; many-to-one with range [0,numLabels).
    • Method Detail

      • getCluster

        public InstanceList getCluster​(int label)
        Return an list of instances with a particular label.
      • getClusters

        public InstanceList[] getClusters()
        Returns an array of instance lists corresponding to clusters.
      • getLabel

        public int getLabel​(int index)
        Get the cluster label for a particular instance.
      • getLabels

        public int[] getLabels()
      • getNumClusters

        public int getNumClusters()
      • getNumInstances

        public int getNumInstances()
      • size

        public int size​(int label)
      • getIndicesWithLabel

        public int[] getIndicesWithLabel​(int label)
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setLabel

        public void setLabel​(int index,
                             int label)
        Set the cluster label for a particular instance.
      • setNumLabels

        public void setNumLabels​(int n)
        Set the number of clusters