Package mvpa :: Package algorithms :: Module cvtranserror :: Class CrossValidatedTransferError
[hide private]
[frames] | no frames]

Class CrossValidatedTransferError

source code


Cross validate a classifier on datasets generated by a splitter from a source dataset.

Arbitrary performance/error values can be computed by specifying an error function (used to compute an error value for each cross-validation fold) and a combiner function that aggregates all computed error values across cross-validation folds.

Nested Classes [hide private]

Inherited from misc.state.ClassWithCollections: __metaclass__

Instance Methods [hide private]
 
__init__(self, transerror, splitter=NoneSplitter(), combiner=GrandMean, expose_testdataset=False, harvest_attribs=None, copy_attribs='copy', **kwargs)
Cheap initialization.
source code
 
_call(self, dataset)
Perform cross-validation on a dataset.
source code

Inherited from measures.base.DatasetMeasure: __call__, __repr__, null_dist

Inherited from measures.base.DatasetMeasure (private): _postcall

Inherited from misc.state.Harvestable (private): _harvest, _setAttribs

Inherited from misc.state.ClassWithCollections: __getattribute__, __new__, __setattr__, __str__, reset

Inherited from object: __delattr__, __format__, __hash__, __reduce__, __reduce_ex__, __sizeof__, __subclasshook__

Class Variables [hide private]
  splits = StateVariable(enabled= False, doc= """Store the actua...
  transerrors = StateVariable(enabled= False, doc= """Store copi...
  confusion = StateVariable(enabled= False, doc= """Store total ...
  training_confusion = StateVariable(enabled= False, doc= """Sto...
  samples_error = StateVariable(enabled= False, doc= "Per sample...
  splitter = property(fget= lambda self: self.__splitter)
  transerror = property(fget= lambda self: self.__transerror)
  combiner = property(fget= lambda self: self.__combiner)

Inherited from measures.base.DatasetMeasure: __doc__, null_prob, null_t, raw_result

Inherited from misc.state.Harvestable: harvest_attribs, harvested

Inherited from misc.state.Harvestable (private): _KNOWN_COPY_METHODS

Inherited from misc.state.ClassWithCollections: _DEV__doc__, descr

Instance Variables [hide private]
  results
Store state variable if it is enabled
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, transerror, splitter=NoneSplitter(), combiner=GrandMean, expose_testdataset=False, harvest_attribs=None, copy_attribs='copy', **kwargs)
(Constructor)

source code 
Cheap initialization.
Parameters:
  • transerror (TransferError instance) - Provides the classifier used for cross-validation.
  • splitter (Splitter instance) - Used to split the dataset for cross-validation folds. By convention the first dataset in the tuple returned by the splitter is used to train the provided classifier. If the first element is 'None' no training is performed. The second dataset is used to generate predictions with the (trained) classifier.
  • combiner (Functor) - Used to aggregate the error values of all cross-validation folds.
  • expose_testdataset (bool) - In the proper pipeline, classifier must not know anything about testing data, but in some cases it might lead only to marginal harm, thus migth wanted to be enabled (provide testdataset for RFE to determine stopping point).
  • harvest_attribs (list of basestr) - What attributes of call to store and return within harvested state variable
  • copy_attribs (None or basestr) - Force copying values of attributes on harvesting
Overrides: object.__init__

_call(self, dataset)

source code 

Perform cross-validation on a dataset.

'dataset' is passed to the splitter instance and serves as the source dataset to generate split for the single cross-validation folds.

Overrides: measures.base.DatasetMeasure._call

Class Variable Details [hide private]

splits

Value:
StateVariable(enabled= False, doc= """Store the actual splits of the d\
ata. Can be memory expensive""")

transerrors

Value:
StateVariable(enabled= False, doc= """Store copies of transerrors at e\
ach step""")

confusion

Value:
StateVariable(enabled= False, doc= """Store total confusion matrix (if\
 available)""")

training_confusion

Value:
StateVariable(enabled= False, doc= """Store total training confusion m\
atrix (if available)""")

samples_error

Value:
StateVariable(enabled= False, doc= "Per sample errors.")