Package mvpa :: Package clfs :: Module base :: Class FeatureSelectionClassifier
[hide private]
[frames] | no frames]

Class FeatureSelectionClassifier

source code


ProxyClassifier which uses some FeatureSelection prior training.

FeatureSelection is used first to select features for the classifier to use for prediction. Internally it would rely on MappedClassifier which would use created MaskMapper.

TODO: think about removing overhead of retraining the same classifier if feature selection was carried out with the same classifier already. It has been addressed by adding .trained property to classifier, but now we should expclitely use isTrained here if we want... need to think more

Nested Classes [hide private]

Inherited from misc.state.Stateful: __metaclass__

Instance Methods [hide private]
 
__init__(self, clf, feature_selection, testdataset=None, **kwargs)
Initialize the instance
source code
 
untrain(self)
Untrain FeatureSelectionClassifier
source code
 
_train(self, dataset)
Train FeatureSelectionClassifier
source code
 
_getFeatureIds(self)
Return used feature ids for FeatureSelectionClassifier
source code
 
_predict(self, data)
Predict using FeatureSelectionClassifier
source code
 
setTestDataset(self, testdataset)
Set testing dataset to be used for feature selection
source code

Inherited from ProxyClassifier: getSensitivityAnalyzer

Inherited from Classifier: __str__, isTrained, predict, regression, train, train2predict, trained

Inherited from misc.state.Stateful: __getattribute__, __repr__, __setattr__, reset

Inherited from object: __delattr__, __hash__, __new__, __reduce__, __reduce_ex__

Class Variables [hide private]
  _clf_internals = ['does_feature_selection', 'meta']
Describes some specifics about the classifier -- is that it is doing regression for instance....
  maskclf = property(lambda x: x.__maskclf, doc= "Used `MappedCl...
  feature_selection = property(lambda x: x.__feature_selection, ...
  testdataset = property(fget= lambda x: x.__testdataset, fset= ...

Inherited from ProxyClassifier: clf

Inherited from Classifier: feature_ids, predicting_time, predictions, retrainable, trained_dataset, trained_labels, training_confusion, training_time, values

Instance Variables [hide private]
  __maskclf
Should become MappedClassifier`(mapper=`MaskMapper) later on.
  __feature_selection
FeatureSelection to select the features prior training
  __testdataset
FeatureSelection might like to use testdataset

Inherited from ProxyClassifier (private): _regression

Inherited from Classifier (private): _train2predict

Properties [hide private]

Inherited from misc.state.Stateful: descr

Inherited from object: __class__

Method Details [hide private]

__init__(self, clf, feature_selection, testdataset=None, **kwargs)
(Constructor)

source code 
Initialize the instance
Parameters:
  • clf (Classifier) - classifier based on which mask classifiers is created
  • feature_selection (FeatureSelection) - whatever FeatureSelection comes handy
  • testdataset (Dataset) - optional dataset which would be given on call to feature_selection
Overrides: object.__init__

untrain(self)

source code 

Untrain FeatureSelectionClassifier

Has to untrain any known classifier

Overrides: Classifier.untrain

_train(self, dataset)

source code 
Train FeatureSelectionClassifier
Overrides: Classifier._train

_getFeatureIds(self)

source code 
Return used feature ids for FeatureSelectionClassifier
Overrides: Classifier._getFeatureIds

_predict(self, data)

source code 
Predict using FeatureSelectionClassifier
Overrides: Classifier._predict

Class Variable Details [hide private]

maskclf

Value:
property(lambda x: x.__maskclf, doc= "Used `MappedClassifier`")

feature_selection

Value:
property(lambda x: x.__feature_selection, doc= "Used `FeatureSelection\
`")

testdataset

Value:
property(fget= lambda x: x.__testdataset, fset= setTestDataset)