Package PyML :: Package containers :: Module aggregate :: Class Aggregate
[frames] | no frames]

Class Aggregate

source code

                object --+        
                         |        
  baseDatasets.BaseDataSet --+    
                             |    
   baseDatasets.WrapperDataSet --+
                                 |
ext.caggregate._object --+       |
                         |       |
    ext.caggregate.DataSet --+   |
                             |   |
      ext.caggregate.Aggregate --+
                                 |
                                Aggregate

combines several C++ dataset objects into a single dataset. its dot product is a weighted sum of the kernels of the individual dataset objects

Construction of an aggregate requires a list of dataset objects. It is assumed that all datasets refer to the same underlying objects so in particular have the same labels and same number of patterns (the labels object is initialized using the labels of the first dataset in the list).

Instance Methods
 
__init__(self, arg, **args)
:Parameters:
source code
 
addData(self, data, weight) 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
 
__len__(self)
the number of patterns in the dataset
source code
 
checkDatas(self, datas) source code

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

    Inherited from baseDatasets.WrapperDataSet
 
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.caggregate.Aggregate
 
addDataSet(*args) source code
 
castToBase(*args) source code
 
dotProduct(*args) source code
 
duplicate(*args) source code
 
show(*args) source code
 
size(*args) source code
    Inherited from ext.caggregate.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.caggregate.Aggregate
  __del__ = lambda self:
  __getattr__ = lambda self, name:
  __swig_destroy__ = _caggregate.delete_Aggregate
  __swig_getmethods__ = {}
  __swig_setmethods__ = {}
Properties

Inherited from object: __class__

Method Details

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

source code 

:Parameters:

  • `arg` - either an Aggregate object (for copy construction) or a list of C++ dataset objects

:Keywords:

  • `weights` - a list of weights used for computing the dot product element i is the weight for dataset i in the aggregate
Overrides: ext.caggregate.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)

__len__(self)
(Length operator)

source code 

the number of patterns in the dataset

Overrides: baseDatasets.WrapperDataSet.__len__
(inherited documentation)