Package mvpa :: Package clfs :: Module meta :: Class BinaryClassifier

[hide private]
[frames] | no frames]

# Class BinaryClassifier

source code

ProxyClassifier which maps set of two labels into +1 and -1

Nested Classes | [hide private]

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

Instance Methods | [hide private]

__init__(self, clf, poslabels, neglabels, **kwargs) Initialize the instance | source code

__repr__(self, prefixes=[]) String definition of the object of ClassWithCollections object | source code

_train(self, dataset) Train BinaryClassifier | source code

_predict(self, data) Predict the labels for a given `data` | source code

Inherited from `ProxyClassifier`: `getSensitivityAnalyzer`, `summary`, `untrain`

Inherited from `base.Classifier`: `__str__`, `clone`, `isTrained`, `predict`, `repredict`, `retrain`, `train`, `trained`

Inherited from `base.Classifier` (private): `_getFeatureIds`, `_postpredict`, `_posttrain`, `_prepredict`, `_pretrain`, `_regressionIsBogus`, `_setRetrainable`

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

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

Class Variables | [hide private]

Inherited from `ProxyClassifier`: `clf` Inherited from `base.Classifier`: `_DEV__doc__`, `feature_ids`, `predicting_time`, `predictions`, `regression`, `retrainable`, `trained_dataset`, `trained_labels`, `trained_nsamples`, `training_confusion`, `training_time`, `values` Inherited from `base.Classifier` (private): `_clf_internals` Inherited from `misc.state.ClassWithCollections`: `descr`

Properties | [hide private]

Inherited from `object`: `__class__`

Method Details | [hide private]

### __init__(self, clf, poslabels, neglabels, **kwargs)
(Constructor)

source code

Initialize the instance

Parameters:
  - `clf` (Classifier) - classifier to use
  - `poslabels` (list) - list of labels which are treated as +1 category
  - `neglabels` (list) - list of labels which are treated as -1 category
Overrides: object.__init__

### __repr__(self, prefixes=[])
(Representation operator)

source code

String definition of the object of ClassWithCollections object

Parameters:
  - `fullname` - Either to include full name of the module
  - `prefixes` - What other prefixes to prepend to list of arguments
Overrides: object.__repr__
  (inherited documentation)

### _train(self, dataset)

source code

Train BinaryClassifier

Overrides: base.Classifier._train

### _predict(self, data)

source code

Predict the labels for a given `data`

Predicts using binary classifier and spits out list (for each sample) where with either poslabels or neglabels as the "label" for the sample. If there was just a single label within pos or neg labels then it would return not a list but just that single label.

Overrides: base.Classifier._predict