Package mvpa :: Package clfs :: Module transerror :: Class TransferError
[hide private]
[frames] | no frames]

Class TransferError

source code


Compute the transfer error of a (trained) classifier on a dataset.

The actual error value is computed using a customizable error function. Optionally the classifier can be trained by passing an additional training dataset to the __call__() method.

Nested Classes [hide private]

Inherited from misc.state.ClassWithCollections: __metaclass__

Instance Methods [hide private]
 
__init__(self, clf, errorfx=MeanMismatchErrorFx(), labels=None, null_dist=None, **kwargs)
Initialization.
source code
 
__copy__(self)
Performs deepcopying of the classifier.
source code
 
_call(self, testdataset, trainingdataset=None)
Compute the transfer error for a certain test dataset.
source code
 
_postcall(self, vdata, wdata=None, error=None) source code
 
errorfx(self) source code
 
null_dist(self) source code

Inherited from ClassifierError: __call__, clf, labels, untrain

Inherited from ClassifierError (private): _precall

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

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

Class Variables [hide private]
  null_prob = StateVariable(enabled= True, doc= "Stores the prob...
  samples_error = StateVariable(enabled= False, doc= "Per sample...
  __doc__ = enhancedDocString('TransferError', locals(), Classif...

Inherited from ClassifierError: confusion, training_confusion

Inherited from misc.state.ClassWithCollections: _DEV__doc__, descr

Instance Variables [hide private]

Inherited from ClassifierError (private): _labels

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, clf, errorfx=MeanMismatchErrorFx(), labels=None, null_dist=None, **kwargs)
(Constructor)

source code 
Initialization.
Parameters:
  • clf - Either trained or untrained classifier
  • labels - if provided, should be a set of labels to add on top of the ones present in testdata
  • train - unless train=False, classifier gets trained if trainingdata provided to __call__
Overrides: object.__init__

Parameters:

clf : Classifier
Either trained or untrained classifier
errorfx
Functor that computes a scalar error value from the vectors of desired and predicted values (e.g. subclass of ErrorFunction)
labels : list
if provided, should be a set of labels to add on top of the ones present in testdata

null_dist : instance of distribution estimator

__copy__(self)

source code 
Performs deepcopying of the classifier.
Overrides: ClassifierError.__copy__

_call(self, testdataset, trainingdataset=None)

source code 

Compute the transfer error for a certain test dataset.

If trainingdataset is not None the classifier is trained using the provided dataset before computing the transfer error. Otherwise the classifier is used in it's current state to make the predictions on the test dataset.

Returns a scalar value of the transfer error.

Overrides: ClassifierError._call

_postcall(self, vdata, wdata=None, error=None)

source code 
Overrides: ClassifierError._postcall

errorfx(self)

source code 
Decorators:
  • @property

null_dist(self)

source code 
Decorators:
  • @property

Class Variable Details [hide private]

null_prob

Value:
StateVariable(enabled= True, doc= "Stores the probability of an error \
result under " "the NULL hypothesis")

samples_error

Value:
StateVariable(enabled= False, doc= "Per sample errors computed by invo\
king the " "error function for each sample individually. " "Errors are\
 available in a dictionary with each " "samples origid as key.")

__doc__

Value:
enhancedDocString('TransferError', locals(), ClassifierError)