Table Of Contents

Previous topic

mvpa.featsel.base

Next topic

mvpa.featsel.ifs

This Page

Quick search

mvpa.featsel.helpers

The comprehensive API documentation for this module, including all technical details, is available in the Epydoc-generated API reference for mvpa.featsel.helpers (for developers).

Classes

BestDetector

class mvpa.featsel.helpers.BestDetector(func=<built-in function min>, lastminimum=False)

Bases: object

Determine whether the last value in a sequence is the best one given some criterion.

Initialize with number of steps

Parameters:
  • fun (functor) – Functor to select the best results. Defaults to min
  • lastminimum (bool) – Toggle whether the latest or the earliest minimum is used as optimal value to determine the stopping criterion.
bestindex

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the BestDetector documentation.

Full API documentation of BestDetector in module mvpa.featsel.helpers.

ElementSelector

class mvpa.featsel.helpers.ElementSelector(mode='discard', **kwargs)

Bases: mvpa.misc.state.ClassWithCollections

Base class to implement functors to select some elements based on a sequence of values.

Cheap initialization.

Parameters:
  • mode ([‘discard’, ‘select’]) – Decides whether to select or to discard features.
mode

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the ElementSelector documentation.

Full API documentation of ElementSelector in module mvpa.featsel.helpers.

FixedErrorThresholdStopCrit

class mvpa.featsel.helpers.FixedErrorThresholdStopCrit(threshold)

Bases: mvpa.featsel.helpers.StoppingCriterion

Stop computation if the latest error drops below a certain threshold.

Initialize with threshold.

Parameters:
  • threshold (float [0,1]) – Error threshold.
threshold

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the FixedErrorThresholdStopCrit documentation.

Full API documentation of FixedErrorThresholdStopCrit in module mvpa.featsel.helpers.

FixedNElementTailSelector

class mvpa.featsel.helpers.FixedNElementTailSelector(nelements, **kwargs)

Bases: mvpa.featsel.helpers.TailSelector

Given a sequence, provide set of IDs for a fixed number of to be selected elements.

Cheap initialization.

Parameters:
  • nselect (int) – Number of elements to select/discard.
nelements

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the FixedNElementTailSelector documentation.

Full API documentation of FixedNElementTailSelector in module mvpa.featsel.helpers.

FractionTailSelector

class mvpa.featsel.helpers.FractionTailSelector(felements, **kwargs)

Bases: mvpa.featsel.helpers.TailSelector

Given a sequence, provide Ids for a fraction of elements

Cheap initialization.

Parameters:
  • felements (float (0,1.0]) – Fraction of elements to select/discard. Note: Even when 0.0 is specified at least one element will be selected.
felements

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the FractionTailSelector documentation.

Full API documentation of FractionTailSelector in module mvpa.featsel.helpers.

MultiStopCrit

class mvpa.featsel.helpers.MultiStopCrit(crits, mode='or')

Bases: mvpa.featsel.helpers.StoppingCriterion

Stop computation if the latest error drops below a certain threshold.

Parameters:
  • crits (list of StoppingCriterion instances) – For each call to MultiStopCrit all of these criterions will be evaluated.
  • mode (any of (‘and’, ‘or’)) – Logical function to determine the multi criterion from the set of base criteria.

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the MultiStopCrit documentation.

Full API documentation of MultiStopCrit in module mvpa.featsel.helpers.

NBackHistoryStopCrit

class mvpa.featsel.helpers.NBackHistoryStopCrit(bestdetector=<mvpa.featsel.helpers.BestDetector object at 0x8fad50c>, steps=10)

Bases: mvpa.featsel.helpers.StoppingCriterion

Stop computation if for a number of steps error was increasing

Initialize with number of steps

Parameters:
  • bestdetector (BestDetector instance) – used to determine where the best error is located.
  • steps (int) – How many steps to check after optimal value.
steps

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the NBackHistoryStopCrit documentation.

Full API documentation of NBackHistoryStopCrit in module mvpa.featsel.helpers.

NStepsStopCrit

class mvpa.featsel.helpers.NStepsStopCrit(steps)

Bases: mvpa.featsel.helpers.StoppingCriterion

Stop computation after a certain number of steps.

Initialize with number of steps.

Parameters:
  • steps (int) – Number of steps after which to stop.
steps

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the NStepsStopCrit documentation.

Full API documentation of NStepsStopCrit in module mvpa.featsel.helpers.

RangeElementSelector

class mvpa.featsel.helpers.RangeElementSelector(lower=None, upper=None, inclusive=False, mode='select', **kwargs)

Bases: mvpa.featsel.helpers.ElementSelector

Select elements based on specified range of values

Initialization RangeElementSelector

Parameters:
  • lower – If not None – select elements which are above of specified value
  • upper – If not None – select elements which are lower of specified value
  • inclusive – Either to include end points
  • mode – overrides parent’s default to be ‘select’ since it is more native for RangeElementSelector XXX TODO – unify??

upper could be lower than lower – then selection is done on values <= lower or >=upper (ie tails). This would produce the same result if called with flipped values for mode and inclusive.

If no upper no lower is set, assuming upper,lower=0, thus outputing non-0 elements

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the RangeElementSelector documentation.

Full API documentation of RangeElementSelector in module mvpa.featsel.helpers.

StoppingCriterion

class mvpa.featsel.helpers.StoppingCriterion

Bases: object

Base class for all functors to decide when to stop RFE (or may be general optimization... so it probably will be moved out into some other module

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the StoppingCriterion documentation.

Full API documentation of StoppingCriterion in module mvpa.featsel.helpers.

TailSelector

class mvpa.featsel.helpers.TailSelector(tail='lower', sort=True, **kwargs)

Bases: mvpa.featsel.helpers.ElementSelector

Select elements from a tail of a distribution.

The default behaviour is to discard the lower tail of a given distribution.

Initialize TailSelector

Parameters:
  • tail ([‘lower’, ‘upper’]) – Choose the tail to be processed.
  • sort (bool) – Flag whether selected IDs will be sorted. Disable if not necessary to save some CPU cycles.

See also

Derived classes might provide additional methods via their base classes. Please refer to the list of base classes (if it exists) at the begining of the TailSelector documentation.

Full API documentation of TailSelector in module mvpa.featsel.helpers.