Package PyML :: Package containers :: Module kernelData :: Class KernelData
[frames] | no frames]

Class KernelData

source code

                 object --+        
                          |        
   baseDatasets.BaseDataSet --+    
                              |    
    baseDatasets.WrapperDataSet --+
                                  |
ext.ckerneldata._object --+       |
                          |       |
    ext.ckerneldata.DataSet --+   |
                              |   |
     ext.ckerneldata.KernelData --+
                                  |
                                 KernelData

A container for holding a dataset with a dot product derived from a pre-computed kernel matrix

File format: delimited file with the first column interpreted as pattern IDs if it is non-numeric; comments can appear with # or % gist format is accepted as well.

Construction:

 Copy construction:
 KernelData(other) optional keyword arguments are the same as
 other dataset containers

 Construction from file:
 KernelData(matrixFile [,labelsFile = labelsFileName, gistFormat = True])
 matrixFile -- a file with the kernel matrix
 labelsFile -- keyword argument containing a file name with the labels.
 the parser tries to automatically guess if the file is in GIST format;
 in case this is not detected, use the 'gistFormat' keyword argument.
 A matrix file with labels in it is not supported yet.
 additional keyword arguments are the same as those supporting reading
 of delimited files.
Instance Methods
 
__init__(self, arg=None, **args)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
copy(self, other, patterns, deepcopy)
Each class that wants to use the generic copy constructor needs to define this function for doing class-specific copying
source code
 
constructFromFile(self, fileName, **args) source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

    Inherited from baseDatasets.WrapperDataSet
 
__len__(self)
the number of patterns in the dataset
source code
 
attachKernel(data, kernel='linear', **args) source code
 
attachLabels(self, labels) source code
 
getX(self) source code
 
get_kernel(self) source code
 
setX(self, value) source code
 
set_kernel(self, value) source code
    Inherited from baseDatasets.BaseDataSet
 
copyConstruct(self, other, **args) source code
 
getKernelMatrix(self)
returns the kernel matrix as a numpy array
source code
 
getTestingFunc(self) source code
 
getTrainingFunc(self) source code
 
registerAttribute(self, attributeName, attributeValue=None, action=None) source code
 
setTestingFunc(self, func) source code
 
setTrainingFunc(self, func) source code
 
test(self, trainingData, **args) source code
 
train(self, **args) source code
    Inherited from ext.ckerneldata.KernelData
 
addRow(*args) source code
 
castToBase(*args) source code
 
center(*args) source code
 
dotProduct(*args) source code
 
duplicate(*args) source code
 
show(*args) source code
 
size(*args) source code
    Inherited from ext.ckerneldata.DataSet
 
computeNorms(*args) source code
 
getKernelMatrixAsVector(*args) source code
 
setKernel(*args) source code
 
setY(*args) source code
Class Variables
  isVector = False
    Inherited from baseDatasets.WrapperDataSet
  X = property(getX, setX, None, 'X')
  isWrapper = True
  kernel = property(get_kernel, set_kernel, None, 'kernel')
    Inherited from baseDatasets.BaseDataSet
  testingFunc = property(getTestingFunc, setTestingFunc, None, '...
  trainingFunc = property(getTrainingFunc, setTrainingFunc, None...
  type = 'dataset'
    Inherited from ext.ckerneldata.KernelData
  __del__ = lambda self:
  __getattr__ = lambda self, name:
  __swig_destroy__ = _ckerneldata.delete_KernelData
  __swig_getmethods__ = {}
  __swig_setmethods__ = {}
Properties

Inherited from object: __class__

Method Details

__init__(self, arg=None, **args)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: ext.ckerneldata.DataSet.__init__

copy(self, other, patterns, deepcopy)

source code 

Each class that wants to use the generic copy constructor needs to define this function for doing class-specific copying

Overrides: baseDatasets.BaseDataSet.copy
(inherited documentation)