Table Of Contents

Previous topic

featsel.ifs

Next topic

algorithms.cvtranserror

This Page

featsel.rfe

Module: featsel.rfe

Inheritance diagram for mvpa.featsel.rfe:

Recursive feature elimination.

RFE

class mvpa.featsel.rfe.RFE(sensitivity_analyzer, transfer_error, feature_selector=FractionTailSelector() fraction=0.050000, bestdetector=<mvpa.featsel.helpers.BestDetector object at 0xa460fac>, stopping_criterion=<mvpa.featsel.helpers.NBackHistoryStopCrit object at 0xa460a0c>, train_clf=None, update_sensitivity=True, **kargs)

Bases: mvpa.featsel.base.FeatureSelection

Recursive feature elimination.

A FeaturewiseDatasetMeasure is used to compute sensitivity maps given a certain dataset. These sensitivity maps are in turn used to discard unimportant features. For each feature selection the transfer error on some testdatset is computed. This procedure is repeated until a given StoppingCriterion is reached.

Such strategy after
Guyon, I., Weston, J., Barnhill, S., & Vapnik, V. (2002). Gene selection for cancer classification using support vector machines. Mach. Learn., 46(1-3), 389–422.
was applied to SVM-based analysis of fMRI data in
Hanson, S. J. & Halchenko, Y. O. (2008). Brain reading using full brain support vector machines for object recognition: there is no “face identification area”. Neural Computation, 20, 486–503.

Note

Available state variables:

  • errors+: State variable
  • history+: State variable
  • nfeatures+: State variable
  • selected_ids: State variable
  • sensitivities: State variable

(States enabled by default are listed with +)

See also

Please refer to the documentation of the base class for more information:

FeatureSelection

Initialize recursive feature elimination

Parameters:
  • sensitivity_analyzer (FeaturewiseDatasetMeasure object) –
  • transfer_error (TransferError object) – used to compute the transfer error of a classifier based on a certain feature set on the test dataset. NOTE: If sensitivity analyzer is based on the same classifier as transfer_error is using, make sure you initialize transfer_error with train=False, otherwise it would train classifier twice without any necessity.
  • feature_selector (Functor) – Given a sensitivity map it has to return the ids of those features that should be kept.
  • bestdetector (Functor) – Given a list of error values it has to return a boolean that signals whether the latest error value is the total minimum.
  • stopping_criterion (Functor) – Given a list of error values it has to return whether the criterion is fulfilled.
  • train_clf (bool) – Flag whether the classifier in transfer_error should be trained before computing the error. In general this is required, but if the sensitivity_analyzer and transfer_error share and make use of the same classifier it can be switched off to save CPU cycles. Default None checks if sensitivity_analyzer is based on a classifier and doesn’t train if so.
  • update_sensitivity (bool) – If False the sensitivity map is only computed once and reused for each iteration. Otherwise the senstitivities are recomputed at each selection step.
  • enable_states (None or list of basestring) – Names of the state variables which should be enabled additionally to default ones
  • disable_states (None or list of basestring) – Names of the state variables which should be disabled