ML.Data.MLData.MLQuantDataSet

Package ML :: Package Data :: Module MLData :: Class MLQuantDataSet |
[hide private]
[frames] | no frames]

# Class MLQuantDataSet

source code

    object --+
             |
     MLDataSet --+
                 |
                MLQuantDataSet

    a data set for holding quantized data

    **Note**

      this is intended to be a read-only data structure
      (i.e. after calling the constructor you cannot touch it)

    **Big differences to MLDataSet**

      1) data are stored in a numpy array since they are homogenous

      2) results are assumed to be quantized (i.e. no qBounds entry is required)

Instance Methods | [hide private]
_CalcNPossible(self, data) calculates the number of possible values of each variable... | source code
GetNamedData(self) returns a list of named examples... | source code
GetAllData(self) returns a *copy* of the data... | source code
GetInputData(self) returns the input data... | source code
GetResults(self) Returns the result fields from each example... | source code
__init__(self, data, nVars=None, nPts=None, nPossibleVals=None, qBounds=None, varNames=None, ptNames=None, nResults=1) Constructor **Arguments** - data: a list of lists containing the data. | source code
Inherited from `MLDataSet`: `AddPoint`, `AddPoints`, `GetNPossibleVals`, `GetNPts`, `GetNResults`, `GetNVars`, `GetPtNames`, `GetQuantBounds`, `GetVarNames`, `__getitem__`, `__setitem__` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### _CalcNPossible(self, data) | source code
    calculates the number of possible values of each variable

    **Arguments**

       -data: a list of examples to be used

    **Returns**

       a list of nPossible values for each variable
Overrides: MLDataSet._CalcNPossible

### GetNamedData(self) | source code
    returns a list of named examples

    **Note**

      a named example is the result of prepending the example
       name to the data list
Overrides: MLDataSet.GetNamedData

### GetAllData(self) | source code
    returns a *copy* of the data
Overrides: MLDataSet.GetAllData

### GetInputData(self) | source code
    returns the input data

    **Note**

      _inputData_ means the examples without their result fields
       (the last _NResults_ entries)
Overrides: MLDataSet.GetInputData

### GetResults(self) | source code
    Returns the result fields from each example
Overrides: MLDataSet.GetResults

### __init__(self, data, nVars=None, nPts=None, nPossibleVals=None, qBounds=None, varNames=None, ptNames=None, nResults=1) (Constructor) | source code
    Constructor

    **Arguments**

      - data: a list of lists containing the data. The data are copied, so don't worry
            about us overwriting them.

      - nVars: the number of variables

      - nPts: the number of points

      - nPossibleVals: an list containing the number of possible values
                     for each variable (should contain 0 when not relevant)
                     This is _nVars_ long

      - qBounds: a list of lists containing quantization bounds for variables
               which are to be quantized (note, this class does not quantize
               the variables itself, it merely stores quantization bounds.
               an empty sublist indicates no quantization for a given variable
               This is _nVars_ long

      - varNames: a list of the names of the variables.
               This is _nVars_ long

      - ptNames: the names (labels) of the individual data points
         This is _nPts_ long

      - nResults: the number of results columns in the data lists.  This is usually
                  1, but can be higher.
Overrides: MLDataSet.__init__