Documentation of 'jminhep.algorithms.FuzzyCMeansAlg' Java class
FuzzyCMeansAlg
jminhep.algorithms

Class FuzzyCMeansAlg



  • public class FuzzyCMeansAlg
    extends java.lang.Object
    Fuzzy C-means cluster algorithm. Look at details in: http://home.dei.polimi.it/matteucc/Clustering/tutorial_html/cmeans.html
    • Constructor Summary

      Constructors 
      Constructor and Description
      FuzzyCMeansAlg(DataHolder data)
      Initialize Fuzzy C-means calculations
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void delete()
      Clear
      int[] getAssignments()
      Returns cluster assignments of all points.
      DataHolder getCenters()
      Returns cluster centers
      int getClusters()
      Get the number of clusters
      double getCompactness()
      This method returns the Compactness and Separation measure of cluster validity (see Fuzzy Algorithms With Applications to Image Processing and Pattern Recognition, Zheru Chi, Hong Yan, Tuan Pham, World Scientific, pp.
      int getError()
      Get error code.
      double[][] getMembeship()
      Return cluster membership
      java.lang.String getName()
      Get the description of the algorithm
      int[] getNumberPoints()
      Returns the number of points in each cluster.
      double getPartitionCoefficient()
      This method returns the Partition Coefficient measure of cluster validity (see Fuzzy Algorithms With Applications to Image Processing and Pattern Recognition, Zheru Chi, Hong Yan, Tuan Pham, World Scientific, pp.
      double getPartitionEntropy()
      This method returns the Partition Entropy measure of cluster validity (see Fuzzy Algorithms With Applications to Image Processing and Pattern Recognition, Zheru Chi, Hong Yan, Tuan Pham, World Scientific, pp.
      long getPosition()
      This method returns a measure of the progress of the algorithm.
      long getSize()
      This method returns the estimated size (steps) for this task.
      boolean isFinished()
      This method returns true if the clustering has finished.
      void run()
      Run classic Fuzzy C-Means clustering algorithm: Calculate the cluster centers.
      void runBest()
      Runs for the best estimate
      void setClusters(int N)
      Set number of clusters for calculations.
      void setOptions(int maxIterations, double epsilon, double fuzziness)
      Set initial conditions for clustering.
      void setProb(double probClusters)
      Set probability of associations with each cluster.
      • Methods inherited from class java.lang.Object

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

      • FuzzyCMeansAlg

        public FuzzyCMeansAlg(DataHolder data)
        Initialize Fuzzy C-means calculations
        Parameters:
        d - input data
    • Method Detail

      • setClusters

        public void setClusters(int N)
        Set number of clusters for calculations.
        Parameters:
        numClusters - Set the desired number of clusters.
      • getClusters

        public int getClusters()
        Get the number of clusters
        Returns:
        number of clusters
      • getMembeship

        public double[][] getMembeship()
        Return cluster membership
        Returns:
        membership matrix (2D)
      • setOptions

        public void setOptions(int maxIterations,
                               double epsilon,
                               double fuzziness)
        Set initial conditions for clustering.
        Parameters:
        maxIterations - the maximum number of iterations.
        fuzziness - the fuzziness (a.k.a. the "m" value)
        epsilon - a small value used to verify if clustering has converged.
      • delete

        public void delete()
        Clear
      • setProb

        public void setProb(double probClusters)
        Set probability of associations with each cluster. The default value is 0.68. Does dot affect calculations.
        Parameters:
        probClusters - probability association.
      • getCenters

        public DataHolder getCenters()
        Returns cluster centers
        Returns:
        DataHolder with cluster centers
      • getAssignments

        public int[] getAssignments()
        Returns cluster assignments of all points. Affected by the method setProb(), which sets association probability (default is 0.68).
        Returns:
        array with cluster assignments
      • getNumberPoints

        public int[] getNumberPoints()
        Returns the number of points in each cluster. Affected by the method setProb(), which sets association probability (default is 0.68). Look also at getAssignment() and getMembership()
        Returns:
        number of points in each cluster
      • runBest

        public void runBest()
        Runs for the best estimate
      • run

        public void run()
        Run classic Fuzzy C-Means clustering algorithm: Calculate the cluster centers. Update the membership function. Calculate statistics and repeat from 1 if needed.
      • getSize

        public long getSize()
        This method returns the estimated size (steps) for this task. The value is, of course, an approximation, just so we will be able to give the user a feedback on the processing time. In this case, the value is calculated as the number of loops in the run() method.
      • getPosition

        public long getPosition()
        This method returns a measure of the progress of the algorithm.
      • isFinished

        public boolean isFinished()
        This method returns true if the clustering has finished.
      • getPartitionCoefficient

        public double getPartitionCoefficient()
        This method returns the Partition Coefficient measure of cluster validity (see Fuzzy Algorithms With Applications to Image Processing and Pattern Recognition, Zheru Chi, Hong Yan, Tuan Pham, World Scientific, pp. 91)
      • getPartitionEntropy

        public double getPartitionEntropy()
        This method returns the Partition Entropy measure of cluster validity (see Fuzzy Algorithms With Applications to Image Processing and Pattern Recognition, Zheru Chi, Hong Yan, Tuan Pham, World Scientific, pp. 91)
      • getError

        public int getError()
        Get error code.
        Returns:
        if 0, clustering looks OK
      • getCompactness

        public double getCompactness()
        This method returns the Compactness and Separation measure of cluster validity (see Fuzzy Algorithms With Applications to Image Processing and Pattern Recognition, Zheru Chi, Hong Yan, Tuan Pham, World Scientific, pp. 93)
      • getName

        public java.lang.String getName()
        Get the description of the algorithm
        Returns:
        algorithm description

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.