Re: [scikit-learn] using a mask for brain images

2017-05-05 Thread Gael Varoquaux
On Fri, May 05, 2017 at 12:13:08PM +0200, Alle Meije Wink wrote: > Thanks for that Gael - I do know nilearn but in this case I did a depth-first > search on doing SVM on brain images and ended up here :) :). Darn, we need to work on our search engine optimization. Nilearn should be the easiest way

Re: [scikit-learn] using a mask for brain images

2017-05-05 Thread Alle Meije Wink
Thanks for that Gael - I do know nilearn but in this case I did a depth-first search on doing SVM on brain images and ended up here :) The size of 'coef' is (1,205739), the size of mask[mask].T is (205739,) Same number of elements, different storage layout(?). Turned out that the numpy.ravel() fun

Re: [scikit-learn] using a mask for brain images

2017-05-04 Thread Gael Varoquaux
Hi Alle, I think that what has changed between 2014 and today is that the coefficients coef are now a 2D array (number of hyperplanes x number of features). In your case, the first direction is of length one, so you could just do: coef = clf.coef_[0] and your script should work. The code of the

[scikit-learn] using a mask for brain images

2017-05-04 Thread Alle Meije Wink
I have a script to classify MRI perfusion maps from healthy subjects and patients. For the file IO and the classifier I have started with the example code in Abraham et al 2014 [https://arxiv.org/pdf/1412.3919.pdf]. I use the same classifier as in the paper to produce a back-projected map of class