[pymvpa] Sensitivities same for each fold?

Per B. Sederberg psederberg at gmail.com
Fri Aug 19 15:03:46 UTC 2011


Here's a short script that illustrates the bug:

from mvpa.suite import *

dataset = normal_feature_dataset(perlabel=100, nlabels=2, nfeatures=10,
                                nonbogus_features=[0,1], snr=0.3, nchunks=2)

zscore(dataset, chunks_attr='chunks')

clfr = LinearCSVMC(enable_ca=['estimates'])

sclf = SplitClassifier(clfr,
                       NFoldPartitioner(),
                       enable_ca=['stats'])

analyzer = sclf.get_sensitivity_analyzer()

senses = analyzer(dataset)

print "This should be False: "
print "\tnp.allclose(senses.samples[0],senses.samples[1]) = " +
str(np.allclose(senses.samples[0],senses.samples[1]))


I'll also try and make a unit test.

Best,
Per


On Thu, Aug 18, 2011 at 10:27 PM, Per B. Sederberg <psederberg at gmail.com> wrote:
> I forgot to mention that I'm running the latest master branch on
> github.  My machine is running Debian testing (64-bit).
>
> Best,
> Per
>
> On Thu, Aug 18, 2011 at 10:26 PM, Per B. Sederberg <psederberg at gmail.com> wrote:
>> Hi Folks!
>>
>> Long time no chat, but I hope all is well.  I'm working on an analysis
>> that hinges on the weights assigned to each voxel to make the
>> classification.  I figured the easy way to do this was with a
>> sensitivity analyzer as such:
>>
>>    clfr = SMLR()
>>
>>    sclf = SplitClassifier(clfr,
>>                           NFoldPartitioner(),
>>                           enable_ca=['stats'])
>>
>>    print "Running CV"
>>    analyzer = sclf.get_sensitivity_analyzer()
>>
>>    senses = analyzer(dat)
>>
>>
>> The problem is that the dataset returned by analyzer has a vector of
>> weights for each class for each fold, but they are the same for each
>> fold, which I can't believe is correct.  I get the same outcome with a
>> LinearSVMC classifier, so it's not an issue in one single classifier.
>>
>> Do we need to do a copy somewhere in there?
>>
>> Thanks for any tips,
>> Per
>>
>



More information about the Pkg-ExpPsy-PyMVPA mailing list