Nilearn Dictionary Learning for Classification

Hi,

I wanted to ask you if someone used the dictionary learning decomposition in nilearn to perform a classification task of patients. I have a dataset of around 100 people and two groups, and I want to use a model to classify them by either directly using the timecourses generated by the dictionary learning or with the functional connectivity of identified regions. My question now is, would I perform dictionary learning to all subjects or just to one group (I think that will probably produce a bias)? Or is there generally a better way to use dictionary lerning for classifcation.

Thanks in advance!