[pymvpa] LinearCSVMC() error with python 2.7 but not 2.6?

Yaroslav Halchenko debian at onerussian.com
Sat Sep 8 02:21:13 UTC 2012


On Fri, 07 Sep 2012, Edmund Chong wrote:

>    Hi Yarik,

>    For both systems:

>    issubclass(LinearCSVMC,libsvm.SVM)
>    is True,
>    and issubclass(LinearCSVMC,sg.SVM)
>    is False.

>      another thing you could if that was under ipython,
>      enable debug mode by entering

>      pdb

>      so it would jump into pdb whenever failure occurs... and then share
>      output of

>      print dist_samples.shape
>      print shape

>    ipdb> print dist_samples.shape
>    (0, 1)
>    ipdb> print shape
>    (0,)

that is really strange given that you have repeater =
Repeater(count=200) so it should have been with a leading dimension of
200, e.g. in my case with your code and testing small dataset and
reduced Repeater to 20 I have:

(Pydb) print dist_samples.shape
(20, 4, 1)
(Pydb) print shape
(20, 4, 1)

>      could you share complete snippet of your code and the dataset (check --
>      may be it fails also with �a small portion of it, e.g. fds1[:, :10]).
>      you can easily share it by saving via h5save
>    This is where it gets a little strange: so I saved my fds1 to hdf5 format.
>    When I loaded it back, the classifier actually works (on the non-working
>    system)! So in my script I added a few lines that saved and then loaded
>    the dataset just before applying the classifier -- I obtain exactly the
>    same results as on the working system. 

indeed "fun"... ok ... would you mind printing a bulky (but you could
try reducing with taking just few features):

print repr(fds1)

before saving and after reloading?  any visible difference?  (you could dump
those repr's into files... e.g. open('/tmp/repr1.txt', 'w').write(repr(fds1))
and then use diff or wdiff or kompare to visualize the difference)

another interesting thing to check -- on that non-working system with
default python 2.7, most porbably 2.6 is also supported so you could try
running non-working (i.e. without this save/reload trick) script with
python2.6 -- would it work?

> So I guess it would not make sense
>    to share the hdf5 file with you -- would you like the .nii instead? And
>    here's the code i used for the classifier:

you could share indeed entire .nii(.gz), all needed mask/attribute files
and code -- I could try to replicate



-- 
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