Skip to content

Commit

Permalink
ENH: simplify SplitRFE doc example to nore require errorfx + reorder …
Browse files Browse the repository at this point in the history
…mappers to have mean(abs(normed)))

Closes PyMVPA#459
Closes PyMVPA#460
  • Loading branch information
yarikoptic committed Apr 19, 2016
1 parent aa218e3 commit 14750b2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions mvpa2/featsel/rfe.py
Expand Up @@ -417,13 +417,11 @@ class SplitRFE(RFE):
>>> rfe = SplitRFE(
... LinearCSVMC(),
... OddEvenPartitioner(),
... # take sensitivities per each split, L2 norm, mean, abs them
... # take sensitivities per each split, L2 norm, abs, mean them
... fmeasure_postproc=ChainMapper([
... FxMapper('features', l2_normed),
... FxMapper('samples', np.mean),
... FxMapper('samples', np.abs)]),
... # use the error stored in the confusion matrix of split classifier
... errorfx=ConfusionBasedError(rfesvm_split, confusion_state='stats'),
... FxMapper('samples', np.abs),
... FxMapper('samples', np.mean)]),
... # select 50% of the best on each step
... fselector=FractionTailSelector(
... 0.50,
Expand Down
4 changes: 2 additions & 2 deletions mvpa2/tests/test_rfe.py
Expand Up @@ -321,8 +321,8 @@ def test_rfe(self, clf):
# of normed sensitivities across those splits
(RFE(rfesvm_split.get_sensitivity_analyzer(
postproc=ChainMapper([ FxMapper('features', l2_normed),
FxMapper('samples', np.mean),
FxMapper('samples', np.abs)])),
FxMapper('samples', np.abs),
FxMapper('samples', np.mean)])),
ConfusionBasedError(rfesvm_split, confusion_state='stats'),
Repeater(2), # we will use the same full cv-training dataset
fselector=FractionTailSelector(
Expand Down

0 comments on commit 14750b2

Please sign in to comment.