Package rdkit :: Package ML :: Package Data :: Module MLData :: Class MLDataSet

[hide private]
[frames] | no frames]

# Class MLDataSet

source code

    object --+
             |
            MLDataSet

    A data set for holding general data (floats, ints, and strings)

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

Instance Methods | [hide private]

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

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

GetNResults(self) | source code

GetNVars(self) | source code

GetNPts(self) | source code

GetNPossibleVals(self) | source code

GetQuantBounds(self) | source code

__getitem__(self, idx) | source code

__setitem__(self, idx, val) | 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

GetVarNames(self) | source code

GetPtNames(self) | source code

AddPoint(self, pt) | source code

AddPoints(self, pts, names) | source code

Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __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: object.__init__

### _CalcNPossible(self, data)

source code

    calculates the number of possible values of each variable (where possible)

    **Arguments**

       -data: a list of examples to be used

    **Returns**

       a list of nPossible values for each variable

### 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

### GetInputData(self)

source code

    returns the input data

    **Note**

      _inputData_ means the examples without their result fields
       (the last _NResults_ entries)