## org.apache.mahout.ga.watchmaker.cd
Class DataSet

    java.lang.Object
      org.apache.mahout.ga.watchmaker.cd.DataSet

    public class DataSet

extends Object

Contains information about the dataset and its attributes. The label is a nominal attribute with a known position. Ignored attributes are not taken into account when calculating attribute's position.

Method Summary
`static DataSet` `getDataSet()` Singleton DataSet
`List<Integer>` `getIgnoredAttributes()`
`int` `getLabelIndex()`
`double` `getMax(int index)` Maximum possible value for an attribute
`double` `getMin(int index)` Minimum possible value for an attribute
`int` `getNbAttributes()`
`int` `getNbValues(int index)` Number of values for a nominal attribute
`static void` `initialize(DataSet dataset)` Initializes the singleton dataset
`boolean` `isNumerical(int index)` Is the attribute numerical or nominal ?
`int` `valueIndex(int index, String value)` Converts a string value of a nominal attribute to an `int`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### getDataSet

    public static DataSet getDataSet()

  Singleton DataSet

  Throws:
    `IllegalStateException` - if the dataset has not been initialized

### initialize

    public static void initialize(DataSet dataset)

  Initializes the singleton dataset

  Parameters:
    `dataset` -

### getNbAttributes

    public int getNbAttributes()

  Returns:
    number of non-ignored attributes.

### getIgnoredAttributes

    public List<Integer> getIgnoredAttributes()

  Returns:
    Indexes of the ignored attributes, if any.

### getLabelIndex

    public int getLabelIndex()

  Returns:
    zero-based position of the label in the dataset.

### getMax

    public double getMax(int index)

  Maximum possible value for an attribute

  Parameters:
    `index` - of the attribute
  Throws:
    `IllegalArgumentException` - if the attribute is nominal

### getMin

    public double getMin(int index)

  Minimum possible value for an attribute

  Parameters:
    `index` - of the attribute
  Throws:
    `IllegalArgumentException` - if the attribute is nominal

### getNbValues

    public int getNbValues(int index)

  Number of values for a nominal attribute

  Parameters:
    `index` - of the attribute
  Throws:
    `IllegalArgumentException` - if the attribute is numerical

### isNumerical

    public boolean isNumerical(int index)

  Is the attribute numerical or nominal ?

  Parameters:
    `index` - of the attribute
  Returns:
    true is numerical, false if nominal

### valueIndex

    public int valueIndex(int index,
                          String value)

  Converts a string value of a nominal attribute to an `int`.

  Parameters:
    `index` - of the attribute
    `value` -
  Returns:
    an `int` representing the value
  Throws:
    `IllegalArgumentException` - if the value is not found.

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.