From 14750b26fa8ef11340f5787232c94eb03b5332e8 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Tue, 19 Apr 2016 17:58:51 -0400 Subject: [PATCH] ENH: simplify SplitRFE doc example to nore require errorfx + reorder mappers to have mean(abs(normed))) Closes #459 Closes #460 --- mvpa2/featsel/rfe.py | 8 +++----- mvpa2/tests/test_rfe.py | 4 ++-- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/mvpa2/featsel/rfe.py b/mvpa2/featsel/rfe.py index bfcf2ab7de..59a0a6ad18 100644 --- a/mvpa2/featsel/rfe.py +++ b/mvpa2/featsel/rfe.py @@ -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, diff --git a/mvpa2/tests/test_rfe.py b/mvpa2/tests/test_rfe.py index fdfca51ce8..1bfd0a2d47 100644 --- a/mvpa2/tests/test_rfe.py +++ b/mvpa2/tests/test_rfe.py @@ -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(