DataHolder
jminhep.cluster

Class DataHolder

  • All Implemented Interfaces:
    Serializable


    public class DataHolderextends Objectimplements 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 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(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 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(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(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 String getRelation()
        Get name of the data holder (i.e. relation)
        Returns:
        name of the data holder
      • getName

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

        public void setName(int i,           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 String toString()
        Convert to string all entries of the data holder
        Overrides:
        toString in class Object
      • main

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

SCaVis 2.0 © jWork.ORG