Thanks for the suggestions! I tried the GNB() classifier, and it did work with that one, so I think it may be an issue with the SVM() classifier not converging. Is there anything you can do about that? I'd be happy to pass along my data if it would be helpful.<br>
<br>-Sarah<br><br>Message: 2<br>
Date: Mon, 1 Oct 2012 12:11:39 -0400<br>
From: Yaroslav Halchenko <<a href="mailto:debian@onerussian.com">debian@onerussian.com</a>><br>
To: <a href="mailto:pkg-exppsy-pymvpa@lists.alioth.debian.org">pkg-exppsy-pymvpa@lists.alioth.debian.org</a><br>
Subject: Re: [pymvpa] PyMVPA searchlight command is freezing up<br>
Message-ID: <<a href="mailto:20121001161139.GI26676@onerussian.com">20121001161139.GI26676@onerussian.com</a>><br>
Content-Type: text/plain; charset=utf-8<br>
<br>On Mon, 01 Oct 2012, Sarah Helfinstein wrote:<br>
<br>
> Hi all,<br>
<br>
> I'm having a bit of a weird problem with a searchlight MVPA I'm running,<br>
> and I'm hoping someone out there can shed some light on what's happening.<br>
> I'm running two MVPAs on my data, one where I pull out the data from each<br>
> searchlight, calculate the mean for the searchlight, and subtract that<br>
> value from each voxel in the searchlight, and another where I calculate<br>
> the mean for the searchlight, then assign that value to each voxel in the<br>
> searchlight (so I can look at classification ability due to differences in<br>
> mean activation btwn categories separately from classification ability due<br>
> to differences in the pattern of activation btwn categories.) The script<br>
> where I subtract the mean from each voxel in the searchlight runs without<br>
> incident on my data, but when I run the one where I'm assigning the<br>
> searchlight mean to each voxel, the script runs fine until about the<br>
> 2,000th searchlight and then it just....freezes. It doesn't throw an<br>
> error; it just goes into the crossvalidation command and never comes out.<br>
> It always stops on the same searchlight, so clearly there's something<br>
> about the data in that searchlight that is tripping up the crossvalidation<br>
> command, but I cannot figure out what. Has anyone else ever had something<br>
> like this happen to them? Or have any idea what might cause a<br>
> crossvalidation to freeze up like this (particularly one where you have<br>
> essentially one piece of information--the searchlight mean--for each<br>
> sample)? Here's the relevant code from the script:<br>
<br>
> def just_the_means(ds):<br>
> ??? i = 0<br>
> ??? while i < ds.shape[0]:<br>
> ??????? #assign the mean value to all voxels in the searchlight??????? ???<br>
> ??? ??? ds.samples[i,:] = numpy.mean(ds.samples[i,:])???<br>
> ??? ??? i = i+1<br>
> ??? classifier = LinearCSVMC()<br>
> ??? #perform a crossvalidation using the adjusted values<br>
> ??? print "ABOUT TO PERFORM CROSSVALIDATION FOR A SEARCHLIGHT AT TIME " +<br>
> str(datetime.datetime.now())<br>
> ??? cvte = CrossValidation(classifier, NFoldPartitioner(), errorfx=lambda<br>
> p, t: numpy.mean(p == t), enable_ca=['stats'])<br>
> ??? return cvte(ds)<br>
<br>
related but not relevant:<br>
<br>
* you could have your code simplified there for while loop with<br>
<br>
for s in ds.samples:<br>
s[:] = numpy.mean(s)<br>
<br>
which would have accomplished the same reassignment with the mean<br>
<br>
<br>
> #run the searchlight<br>
> s1 = sphere_searchlight(just_the_<div id=":1ep">means, radius = 3)<br>
> just_the_means_results = s1(dataset)<br>
<br>
to see if that is an effect within SVM failing to converge somehow --<br>
just try using different classifier, e.g. GNB() for a quick check. If<br>
it passes with it -- then it is a problem with SVM and we will look into<br>
it then...<br>
<br>
Also -- you could have avoided custom code above ( I believe) with just<br>
using a MappedClassifier(classifier, mean_feature()) within a<br>
conventional CrossValidation() without coming up with a custom<br>
just_the_means()<br>
<br>
--<br>
Yaroslav O. Halchenko<br>
Postdoctoral Fellow, Department of Psychological and Brain Sciences<br>
Dartmouth College, 419 Moore Hall, Hinman Box 6207, Hanover, NH 03755<br>
Phone: +1 (603) 646-9834 Fax: +1 (603) 646-1419<br>
WWW: <a href="http://www.linkedin.com/in/yarik" target="_blank">http://www.linkedin.com/in/yarik</a></div>