Package mvpa :: Package featsel :: Module ifs :: Class IFS
[hide private]
[frames] | no frames]

Class IFS

source code


Incremental feature search.

A scalar DatasetMeasure is computed multiple times on variations of a certain dataset. These measures are in turn used to incrementally select important features. Starting with an empty feature set the dataset measure is first computed for each single feature. A number of features is selected based on the resulting data measure map (using an ElementSelector).

Next the dataset measure is computed again using each feature in addition to the already selected feature set. Again the ElementSelector is used to select more features.

For each feature selection the transfer error on some testdatset is computed. This procedure is repeated until a given StoppingCriterion is reached.

Nested Classes [hide private]

Inherited from misc.state.ClassWithCollections: __metaclass__

Instance Methods [hide private]
 
__init__(self, data_measure, transfer_error, bestdetector=BestDetector(), stopping_criterion=NBackHistoryStopCrit(BestDetector()), feature_selector=FixedNElementTailSelector(1,tail='upper',mode='select'), **kwargs)
Initialize incremental feature search
source code
 
__call__(self, dataset, testdataset)
Proceed and select the features recursively eliminating less important ones.
source code

Inherited from base.FeatureSelection: untrain

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]
  errors = StateVariable()

Inherited from base.FeatureSelection: selected_ids

Inherited from misc.state.ClassWithCollections: _DEV__doc__, descr

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data_measure, transfer_error, bestdetector=BestDetector(), stopping_criterion=NBackHistoryStopCrit(BestDetector()), feature_selector=FixedNElementTailSelector(1,tail='upper',mode='select'), **kwargs)
(Constructor)

source code 
Initialize incremental feature search
Parameters:
  • data_measure (DatasetMeasure) - Computed for each candidate feature selection.
  • transfer_error (TransferError) - Compute against a test dataset for each incremental feature set.
  • 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.
Overrides: object.__init__

__call__(self, dataset, testdataset)
(Call operator)

source code 

Proceed and select the features recursively eliminating less important ones.

Returns a tuple with the dataset containing the feature subset of dataset that had the lowest transfer error of all tested sets until the stopping criterion was reached. The tuple also contains a dataset with the corrsponding features from the testdataset.

Parameters:
  • dataset - dataset used to select features
  • testdataset - dataset the might be used to compute a stopping criterion
Overrides: base.FeatureSelection.__call__

Parameters:

dataset: Dataset
used to select features and train classifiers to determine the transfer error.
testdataset: Dataset
used to test the trained classifer on a certain feature set to determine the transfer error.