Esempio n. 1
0
    def __init__(self, arg, *opt, **args) :

        BaseDataSet.__init__(self)
        if arg.__class__ == self.__class__ :
            other = arg
            self.datas = [other.datas[i].__class__(other.datas[i], *opt, **args)
                          for i in range(len(other.datas))]
        elif type(arg) == type([]) :
            self.datas = arg
        else :
            raise ValueError, 'wrong type of input for DataAggregate'
        self.labels = self.datas[0].labels
Esempio n. 2
0
 def __init__(self, arg, **args) :
     """
     :Parameters:
       - `arg` - a file name or another PairDataSet object.
         if a file name is supplied the constructor expects a dataset
         object as a keyword argument 'data'
     :Keywords:
       - `data` - a dataset object from which the kernel between the pairs
         of patterns is derived.
       - `patterns` - patterns to copy when performing copy construction
     """
     BaseDataSet.__init__(self, arg, **args)
Esempio n. 3
0
 def __init__(self, arg, **args):
     """
     :Parameters:
       - `arg` - a file name or another PairDataSet object.
         if a file name is supplied the constructor expects a dataset
         object as a keyword argument 'data'
     :Keywords:
       - `data` - a dataset object from which the kernel between the pairs
         of patterns is derived.
       - `patterns` - patterns to copy when performing copy construction
     """
     BaseDataSet.__init__(self, arg, **args)
Esempio n. 4
0
    def __init__(self, arg, **args) :
	"""
        :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
	"""
        BaseDataSet.__init__(self, arg, **args)
        self._trainingFunc = self.aggregate_train
        self._testingFunc = self.aggregate_test
Esempio n. 5
0
    def __init__(self, arg, **args):
        """
        :Parameters:
          - `arg` - a file name or another PairDataSet object.
            if a file name is supplied the constructor expects a dataset
            object as a keyword argument 'data'
        :Keywords:
          - `data` - a dataset object from which the kernel between the pairs
            of patterns is derived.
          - `patterns` - patterns to copy when performing copy construction
        """

        BaseDataSet.__init__(self)
        if arg.__class__ == self.__class__:
            self.copyConstruct(arg, **args)
        elif type(arg) == type(''):
            if 'data' not in args:
                raise ValueError, 'missing data object'
            self._data = args['data']
            self.constructFromFile(arg)

        self.attachKernel('linear')
Esempio n. 6
0
    def __init__(self, arg, **args):
        """
        :Parameters:
          - `arg` - a file name or another PairDataSet object.
            if a file name is supplied the constructor expects a dataset
            object as a keyword argument 'data'
        :Keywords:
          - `data` - a dataset object from which the kernel between the pairs
            of patterns is derived.
          - `patterns` - patterns to copy when performing copy construction
        """

        BaseDataSet.__init__(self)
        if arg.__class__ == self.__class__:
            self.copyConstruct(arg, **args)
        elif type(arg) == type(""):
            if "data" not in args:
                raise ValueError, "missing data object"
            self._data = args["data"]
            self.constructFromFile(arg)

        self.attachKernel("linear")
Esempio n. 7
0
    def __init__(self, arg, **args) :
        """
        :Parameters:
          - `arg` - a file name or another PairDataSet object.
            if a file name is supplied the constructor expects a dataset
            object as a keyword argument 'data'
        :Keywords:
          - `data` - a dataset object from which the kernel between the pairs
            of patterns is derived.
          - `patterns` - patterns to copy when performing copy construction
        """

        BaseDataSet.__init__(self)
        if arg.__class__ == self.__class__ :
            if 'patterns' in args :
                patterns = args['patterns']
            else :
                patterns = range(len(arg))
            self.copyConstruct(arg, patterns)
        elif type(arg) == type('') :
            if 'data' not in args :
                raise ValueError, 'missing data object'
            self.data = args['data']
            self.constructFromFile(arg)
Esempio n. 8
0
 def __init__(self, arg=None, **args) :
     self.container = csequencedata.SequenceData
     BaseDataSet.__init__(self, arg, **args)
     self.initialize(**args)
 def __init__(self, arg=None, **args):
     self.container = csequencedata.SequenceData
     BaseDataSet.__init__(self, arg, **args)
     self.initialize(**args)