Package mvpa :: Package clfs :: Module meta :: 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.ClassWithCollections: __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
 
getSensitivityAnalyzer(self, slave_kwargs, **kwargs)
Return an appropriate SensitivityAnalyzer
source code

Inherited from ProxyClassifier: __repr__, summary

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

Inherited from base.Classifier (private): _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]
  _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 base.Classifier: _DEV__doc__, feature_ids, predicting_time, predictions, regression, retrainable, trained_dataset, trained_labels, trained_nsamples, training_confusion, training_time, values

Inherited from misc.state.ClassWithCollections: descr

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
Properties [hide private]

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: base.Classifier.untrain

_train(self, dataset)

source code 
Train FeatureSelectionClassifier
Overrides: base.Classifier._train

_getFeatureIds(self)

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

_predict(self, data)

source code 
Predict using FeatureSelectionClassifier
Overrides: base.Classifier._predict

getSensitivityAnalyzer(self, slave_kwargs, **kwargs)

source code 

Return an appropriate SensitivityAnalyzer

had to clone from mapped classifier???

Decorators:
  • @group_kwargs(prefixes= ['slave_'], passthrough= True)
Overrides: base.Classifier.getSensitivityAnalyzer

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)