Package mvpa :: Package clfs :: Module transerror :: Class ClassifierError

[hide private]
[frames] | no frames]

# Class ClassifierError

source code

Compute (or return) some error of a (trained) classifier on a dataset.

Nested Classes | [hide private]

Inherited from `misc.state.ClassWithCollections`: `__metaclass__`

Instance Methods | [hide private]

__init__(self, clf, labels=None, train=True, **kwargs) Initialization. | source code

__copy__(self) TODO: think... may be we need to copy self.clf | source code

_precall(self, testdataset, trainingdataset=None) Generic part which trains the classifier if necessary | source code

_call(self, testdataset, trainingdataset=None) | source code

_postcall(self, testdataset, trainingdataset=None, error=None) | source code

__call__(self, testdataset, trainingdataset=None) Compute the transfer error for a certain test dataset. | source code

untrain(self) Untrain the *Error which relies on the classifier | source code

clf(self) | source code

labels(self) | source code

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]

| confusion = `StateVariable(enabled= False)` TODO Think that labels might be also symbolic thus can't directly be indicies of the array
| training_confusion = `StateVariable(enabled= False, doc= "Proxy`...``
| __doc__ = `enhancedDocString('ClassifierError', locals(), Class`...``
Inherited from `misc.state.ClassWithCollections`: `_DEV__doc__`, `descr`

Instance Variables | [hide private]

| _labels Labels to add on top to existing in testing data
| __train Either to train classifier if trainingdata is provided

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, clf, labels=None, train=True, **kwargs)
(Constructor)

source code

Initialization.

Parameters:
  - `clf` (Classifier) - Either trained or untrained classifier
  - `labels` (list) - if provided, should be a set of labels to add on top of the ones present in testdata
  - `train` (bool) - unless train=False, classifier gets trained if trainingdata provided to __call__
Overrides: object.__init__

### __call__(self, testdataset, trainingdataset=None)
(Call operator)

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.

### clf(self)

source code

Decorators:
  - `@property`

### labels(self)

source code

Decorators:
  - `@property`

Class Variable Details | [hide private]

### training_confusion

Value:

      StateVariable(enabled= False, doc= "Proxy training_confusion from unde
      rlying classifier.")

### __doc__

Value:

      enhancedDocString('ClassifierError', locals(), ClassWithCollections)