[pymvpa] Can't access an enabled classifier attribute.

Yaroslav Halchenko debian at onerussian.com
Tue Nov 27 14:49:34 UTC 2012

On Tue, 27 Nov 2012, Roberto Guidotti wrote:

>    Dear all,
>    I've a problem with classifier's conditional attributes (it is possibly
>    due to a bad command understanding, by myself, I admit!):
>    clf = LinearCSVMC(C=1, probability=1, enable_ca=['probabilities'])
>    cvte = CrossValidation(clf, NFoldPartitioner(cvtype = 1),
>    enable_ca=['stats', 'repetition_results'])
>    train_err = cvte(evds)
>    When I try to see inside the conditional attributes of my trained
>    classifier clf with the command below
>    probabilities = clf.ca.probabilities

odd enough above snippet (with probabilities = clf.ca.probabilities)
works for me just fine.  but -- this way you are obtaining
probabilities only for the last cross-validation fold.  what is the goal
-- to get them for every CV fold? (then CrossValidation should get a
callback to harvest them) or on all the data (then you would need to
"clf.train(evds); clf.predict(evds);" and then gather

>    I have this exception
>    UnknownStateError: Unknown yet value of probabilities
>    Instead using a classifier defined as:
>    clf = LinearCSVMC(C=1, probability=1, enable_ca=['probabilities',
>    'training_stats'])
>    I could store my probabilities.
>    Am I doing all the things well?
>    Thank you
>    Roberto
Yaroslav O. Halchenko
Postdoctoral Fellow,   Department of Psychological and Brain Sciences
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755
Phone: +1 (603) 646-9834                       Fax: +1 (603) 646-1419
WWW:   http://www.linkedin.com/in/yarik        

More information about the Pkg-ExpPsy-PyMVPA mailing list