[pymvpa] Returning trained classifiers generated during cross-validation

Yaroslav Halchenko debian at onerussian.com
Mon Jan 9 00:14:59 UTC 2012

there are 2 ways:

1. [available only in mvpa2]
   any RepeatedMeasure (including CrossValidation) takes argument

       callback : functor
          Optional callback to extract information from inside the main loop of
          the measure. The callback is called with the input 'data', the 'node'
          instance that is evaluated repeatedly and the 'result' of a single
          evaluation -- passed as named arguments (see labels in quotes) for
          every iteration, directly after evaluating the node.

   so there you could access anything you care about in the 'node', which is
   classifier in this case

   BUT because the same classifier instance gets reused through the iterations,
   you can't just "store" the classifier.  you can deepcopy some of them (e.g. 
   the ones relying on swig-ed APIs, like libsvm, would not be deepcopy-able)

2. SplitClassifier

   That one behaves similarly to cross-validation (just access its .ca.stats to
   get results of cross-validation), but also operates on copies of the originally
   provided classifier, so you could access all of them via .clfs attribute.


On Sun, 08 Jan 2012, Tyson Aflalo wrote:

>    Is there a means of accessing each trained classifier that is generated as
>    part of a cross-validation analysis?�

>    Thanks,

>    tyson

> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa

Keep in touch                                     www.onerussian.com
Yaroslav Halchenko                 www.ohloh.net/accounts/yarikoptic

More information about the Pkg-ExpPsy-PyMVPA mailing list