[pymvpa] RFE confusion_state

Yaroslav Halchenko debian at onerussian.com
Tue Jun 14 21:34:21 UTC 2011


sorry... didn't have change to look in detail -- I guess that doc page
of ours got outdated since it reflects how you would do RFE using 0.4.x
version of PyMVPA.  So you could do it  that way if you used 0.4.7.
Sorry about the confusion.

For 0.6.x -- here is an example from our unittests which I hope would be of
help help.  It does pretty much the same ;-)

    def test_james_problem(self):
        percent = 80
        dataset = datasets['uni2small']
        rfesvm_split = LinearCSVMC()
        fs = \
            RFE(rfesvm_split.get_sensitivity_analyzer(),
                ProxyMeasure(rfesvm_split,
                             postproc=BinaryFxNode(mean_mismatch_error,
                                                   'targets')),
                Splitter('train'),
                fselector=FractionTailSelector(
                    percent / 100.0,
                    mode='select', tail='upper'), update_sensitivity=True)

        clf = FeatureSelectionClassifier(
            LinearCSVMC(),
            # on features selected via RFE
            fs)
             # update sensitivity at each step (since we're not using the
             # same CLF as sensitivity analyzer)

        cv = CrossValidation(clf, NFoldPartitioner(), postproc=mean_sample(),
            enable_ca=['confusion'])


if you want to see the progress of RFE -- just enable debug variables
RFEC and RFEC_ for more verbosity... eg. in the environment 

export MVPA_DEBUG=RFEC,RFEC_

before running your python script

On Tue, 14 Jun 2011, Kimberly Zhou wrote:

>    Hi all,
>    I'm still trying to get recursive feature selection to work with the
>    example from
>    [1]http://dev.pymvpa.org/featsel.html#recursive-feature-elimination,
>    however I can't get past an error from the line with
>    confusion_state="confusion".
>    Here's the code:
-- 
=------------------------------------------------------------------=
Keep in touch                                     www.onerussian.com
Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic



More information about the Pkg-ExpPsy-PyMVPA mailing list