Documentation of 'medusa.georgios.ClusteringAlgorithms.KMeans2' Java class
KMeans2
medusa.georgios.ClusteringAlgorithms

Class KMeans2



  • public class KMeans2
    extends java.lang.Object
    Implements the k-means algorithm
    • Constructor Summary

      Constructors 
      Constructor and Description
      KMeans2(int k, BasicGraph g) 
      KMeans2(int k, java.util.List kMeansPoints)
      Returns a new instance of kMeans algorithm
      KMeans2(int k, java.lang.String inputFileName)
      Returns a new instance of kMeans algorithm
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      medusa.georgios.ClusteringAlgorithms.cluster getCluster(int index)
      Returns the specified cluster by index
      java.util.Map<java.lang.String,java.lang.Integer> getClusterMap() 
      java.util.Vector getDataPoints()
      Returns the data points
      int getK()
      Returns the value of k
      java.lang.String getReport() 
      int getSmallestClusterSize() 
      static void main(java.lang.String[] args)
      Main method -- to test the kMeans class
      void readData()
      Reads the input data from the file and stores the data points in the vector
      void runKMeans()
      Runs the k-means algorithm over the data set
      java.lang.String Save_To_File(java.lang.String filename) 
      void Save_To_File(java.lang.String filename, java.lang.String information) 
      java.lang.String toString()
      Returns the string output of the data points
      • Methods inherited from class java.lang.Object

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

      • KMeans2

        public KMeans2(int k,
                       java.lang.String inputFileName)
        Returns a new instance of kMeans algorithm
        Parameters:
        k - number of clusters
        inputFileName - name of the file containing input data
      • KMeans2

        public KMeans2(int k,
                       java.util.List kMeansPoints)
        Returns a new instance of kMeans algorithm
        Parameters:
        k - number of clusters
        kMeansPoints - List containing objects of type kMeansPoint
    • Method Detail

      • readData

        public void readData()
                      throws java.io.IOException
        Reads the input data from the file and stores the data points in the vector
        Throws:
        java.io.IOException
      • runKMeans

        public void runKMeans()
        Runs the k-means algorithm over the data set
      • Save_To_File

        public java.lang.String Save_To_File(java.lang.String filename)
      • getK

        public int getK()
        Returns the value of k
        Returns:
        the value of k
      • getCluster

        public medusa.georgios.ClusteringAlgorithms.cluster getCluster(int index)
        Returns the specified cluster by index
        Parameters:
        index - index of the cluster to be returned
        Returns:
        return the specified cluster by index
      • toString

        public java.lang.String toString()
        Returns the string output of the data points
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string output of the data points
      • getDataPoints

        public java.util.Vector getDataPoints()
        Returns the data points
        Returns:
        the data points
      • getClusterMap

        public java.util.Map<java.lang.String,java.lang.Integer> getClusterMap()
      • getReport

        public java.lang.String getReport()
      • Save_To_File

        public void Save_To_File(java.lang.String filename,
                                 java.lang.String information)
      • getSmallestClusterSize

        public int getSmallestClusterSize()
      • main

        public static void main(java.lang.String[] args)
        Main method -- to test the kMeans class
        Parameters:
        args - command line arguments

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.