Documentation of 'jminhep.cluster.DataHolder' Java class
DataHolder
jminhep.cluster

Class DataHolder

  • All Implemented Interfaces:
    java.io.Serializable


    public class DataHolder
    extends java.lang.Object
    implements java.io.Serializable
    Represents an abstraction for a data holder in many dimensional space. All cluster operations are done using this holder
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      DataHolder()
      Creates a new empty instance of data holder
      DataHolder(DataPoint xMin, DataPoint xMax, int Dim, int Size)
      Creates data holder with random number Input:
      DataHolder(int dim)
      Creates a new empty instance of data point
      DataHolder(java.lang.String name)
      Creates a new empty instance of data point
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(DataPoint p)
      Add a data point to the holder
      void add(double[] xx)
      Add a new instance to data holder in form of array
      void analyseSet()
      Analyse the data holder by calculating min and max.
      void clear()
      Clear current data holder
      void fillRandom(DataPoint xMin, DataPoint xMax, int Dim, int Size)
      Fill an existing data holder with random numbers
      DataPoint[] getArray()
      Get the data in form of Array
      java.util.ArrayList getArrayList()
      Get all elements of the data holder in form of an ArrayList
      int getDimention()
      Get the dimension of the data
      double[] getElement(int n)
      Get array of elements at position n of the data holder
      DataPoint getMax()
      Get Max values of the data
      DataPoint getMin()
      Get Min values of the data holder
      java.lang.String getName(int i)
      Get name of the i-th attribute
      java.lang.String getRelation()
      Get name of the data holder (i.e.
      DataPoint getRow(int n)
      Get DataPoint at the position n
      int getSize()
      Get size of the data holder
      static void main(java.lang.String[] args)
      Main method -- to test the DataPoint class
      void print()
      Print all entries of the data holder
      void read(java.lang.String file)
      Reads the input data from the ARFF file and stores in the data holder
      void setDimention(int Dim)
      Set the dimension of the data
      void setName(int i, java.lang.String title)
      Set the title for ith component
      void setRelation(java.lang.String s)
      Set relation (name) of the data holder
      java.lang.String toString()
      Convert to string all entries of the data holder
      • Methods inherited from class java.lang.Object

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

      • DataHolder

        public DataHolder()
        Creates a new empty instance of data holder
      • DataHolder

        public DataHolder(int dim)
        Creates a new empty instance of data point
        Parameters:
        dim - dimension
      • DataHolder

        public DataHolder(java.lang.String name)
        Creates a new empty instance of data point
        Parameters:
        name - Name of this data holder
      • DataHolder

        public DataHolder(DataPoint xMin,
                          DataPoint xMax,
                          int Dim,
                          int Size)
        Creates data holder with random number Input:
        Parameters:
        xMin - min number of DataPoint
        xMax - max number of DataPoint
        Dim - integer dimension of DataPoint
        Size - number of rows
    • Method Detail

      • fillRandom

        public void fillRandom(DataPoint xMin,
                               DataPoint xMax,
                               int Dim,
                               int Size)
        Fill an existing data holder with random numbers
        Parameters:
        xMin - Min DataPoint
        xMax - Max DataPoint
        Dim - Dimension of DataPoint
        Size - Number of rows
      • getArrayList

        public java.util.ArrayList getArrayList()
        Get all elements of the data holder in form of an ArrayList
        Returns:
        ArrayList
      • getArray

        public DataPoint[] getArray()
        Get the data in form of Array
        Returns:
        DataPoint[]
      • clear

        public void clear()
        Clear current data holder
      • add

        public void add(DataPoint p)
        Add a data point to the holder
        Parameters:
        p - New point
      • setRelation

        public void setRelation(java.lang.String s)
        Set relation (name) of the data holder
        Parameters:
        s - name to be set
      • add

        public void add(double[] xx)
        Add a new instance to data holder in form of array
        Parameters:
        xx - array
      • read

        public void read(java.lang.String file)
        Reads the input data from the ARFF file and stores in the data holder
      • getDimention

        public int getDimention()
        Get the dimension of the data
        Returns:
        dimension (int)
      • setDimention

        public void setDimention(int Dim)
        Set the dimension of the data
        Parameters:
        Dim - dimension
      • analyseSet

        public void analyseSet()
        Analyse the data holder by calculating min and max. You can access these values by calling GetMin() anf GetMax()
      • getMin

        public DataPoint getMin()
        Get Min values of the data holder
        Returns:
        DataPoint
      • getMax

        public DataPoint getMax()
        Get Max values of the data
        Returns:
        DataPoint
      • getSize

        public int getSize()
        Get size of the data holder
        Returns:
        Size of the data holder (int)
      • getRelation

        public java.lang.String getRelation()
        Get name of the data holder (i.e. relation)
        Returns:
        name of the data holder
      • getName

        public java.lang.String getName(int i)
        Get name of the i-th attribute
        Returns:
        Name of the attribute
      • setName

        public void setName(int i,
                            java.lang.String title)
        Set the title for ith component
        Parameters:
        i - Index of a component
        title - New title
      • getElement

        public double[] getElement(int n)
        Get array of elements at position n of the data holder
        Returns:
        array with the data at a position n (double[])
      • getRow

        public DataPoint getRow(int n)
        Get DataPoint at the position n
        Returns:
        DataPoint
      • print

        public void print()
        Print all entries of the data holder
      • toString

        public java.lang.String toString()
        Convert to string all entries of the data holder
        Overrides:
        toString in class java.lang.Object
      • main

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

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.