Documentation of 'ca.pfv.spmf.patterns.cluster.Cluster' Java class
Cluster
ca.pfv.spmf.patterns.cluster

Class Cluster



  • public class Cluster
    extends java.lang.Object
    This class represents a cluster found by a clustering algorithm such as K-Means. A cluster is a list of vectors of doubles.
    See Also:
    DoubleArray
    • Constructor Summary

      Constructors 
      Constructor and Description
      Cluster(int vectorsSize)
      Constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addVector(DoubleArray vector)
      Add a vector of doubles to this cluster.
      boolean contains(DoubleArray vector)
      Check if a vector is contained in this cluster.
      DoubleArray getmean()
      Getter for the mean
      java.util.List<DoubleArray> getVectors()
      Method to get the vectors in this cluster
      void recomputeClusterMean()
      This method is called by clustering algorithms to recompute the mean of the cluster.
      void remove(DoubleArray vector)
      Method to remove a vector from this cluster and update the internal sum of vectors at the same time.
      void removeVector(DoubleArray vector)
      Method to remove a vector from this cluster without updating internal structures.
      void setMean(DoubleArray mean)
      Setter for the mean of this cluster.
      java.lang.String toString()
      Return a string representing this cluster.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Cluster

        public Cluster(int vectorsSize)
        Constructor
        Parameters:
        vectorsSize - the size of the vectors to be stored in this cluster
    • Method Detail

      • setMean

        public void setMean(DoubleArray mean)
        Setter for the mean of this cluster.
        Parameters:
        mean - A vector of double that will be set as the mean of this cluster.
      • addVector

        public void addVector(DoubleArray vector)
        Add a vector of doubles to this cluster.
        Parameters:
        vector - The vector of doubles to be added.
      • getmean

        public DoubleArray getmean()
        Getter for the mean
        Returns:
        return the mean of this cluster
      • toString

        public java.lang.String toString()
        Return a string representing this cluster.
        Overrides:
        toString in class java.lang.Object
      • recomputeClusterMean

        public void recomputeClusterMean()
        This method is called by clustering algorithms to recompute the mean of the cluster.
      • getVectors

        public java.util.List<DoubleArray> getVectors()
        Method to get the vectors in this cluster
        Returns:
        the vectors.
      • remove

        public void remove(DoubleArray vector)
        Method to remove a vector from this cluster and update the internal sum of vectors at the same time.
        Parameters:
        vector - the vector to be removed
      • removeVector

        public void removeVector(DoubleArray vector)
        Method to remove a vector from this cluster without updating internal structures.
        Parameters:
        vector - the vector to be removed
      • contains

        public boolean contains(DoubleArray vector)
        Check if a vector is contained in this cluster.
        Parameters:
        vector - A vector of doubles
        Returns:
        true if the vector is contained in this cluster.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.