[pymvpa] Sifter for post-processing of Balancer's output

Usman Sheikh u.sheikh at bcbl.eu
Sun Dec 17 12:34:49 UTC 2017


Hi everyone, 

I was just wondering if you have seen my last email, regarding the use of Sifter for post-processing of Balancer's output. I understand you must be busy with other posts/questions/problems. So, just to remind you, in case you find some time to give a feedback, I'll be very thankful. 

Thanks, 
Usman Ayub Sheikh 
Predoctoral Researcher 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 


From: "Usman Sheikh" <u.sheikh at bcbl.eu> 
To: "pkg-exppsy-pymvpa" <pkg-exppsy-pymvpa at lists.alioth.debian.org> 
Sent: Wednesday, December 6, 2017 3:09:32 PM 
Subject: [pymvpa] Sifter for post-processing of Balancer's output 



Hi PyMVPA people, 





I want to ask if the method I am using for PyMVPA decoding for the problem summarized below makes sense. Also, if it does not make sense, what's wrong with it and what would be the better way to achieve what I want to achieve here. 




Problem: 

------------ 


I am performing within -subject classification. Each dataset has 8 fMRI runs , each of the runs comprises of 2 blocks of 8 trials. The re are two classes of visual stimuli that I aim to decode. However, these stimulus classes can occur at different levels of perceptual visibility. 




The problem is, since number of examples corresponding to each of different combinations of classes such as (visibility -1, stimulus-1), ( visibility -1, stimulus-2), ( visibility -2, stimulus-1), ( visibility -2, stimulus-2 ) is neither equal in sessions nor in blocks. 




I want to do MVPA decoding of the stimulus class both within each level of visibility and across levels (e.g. training on visible trials and testing on less visible trials and vice versa). And while doing that, we want to make sure that the classes in each of the cross-validation folds are balanced. 







What I am doing is: 

-------------------------- 


Once the dataset has been labeled with sample attributes of stimulus class and visibility , I am slicing it to a smaller set using e.g. ds_ = ds[ds.sa. visibility == 1] and then using CustomPartitioner (specs already calculated and checked) with trials (unique id of each trial) as attributes and cvtype of 0.25. But this will not give me balanced sets; so I use a Balancer to balance them with 'partitions' as limit. Balancer returns some sets where both ‘stimulus 1 category' and ' stimulus 2 category' are not present, say for visibility 2 or 3 . To exclude these sets I use a Sifter. And now, I am getting equal number of both stimulus classes in each of the cross-validation folds. The ratio of 0.25 is not preserved in all of the sets but that's understandable. 




pt = ChainNode([CustomPartitioner(specs, attr = 'trials'), 

Balancer(attr = 'targets', 

count = 1, 

limit = 'partitions', 

apply_selection = True), 

Sifter([('partitions', 2), 

('targets', {'uvalues': [0, 1]}) 

]) 

], 

space = 'partitions') 







Question: 

------------- 


Does this make sense? Do you see any problem with this analysis? I have also printed out the examples ratio of each stimulus class for each of the conditions with and without Sifter, with and without Balancer, and it seems to be working well. 


If you have any feedback or further suggestions that would be much appreciated! 




Thanks, 
Usman Ayub Sheikh 
Predoctoral Researcher 
www.bcbl.eu 

Legal disclaimer/Aviso legal/Lege-oharra: www.bcbl.eu/legal-disclaimer 

_______________________________________________ 
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 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20171217/a108e801/attachment-0003.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list