49257721ec65c78965df63152b8933e9baebd4a6,examples/decoding/plot_poldrack_space_net.py,,,#,11

Before Change



////// Fit and predict ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
from nilearn.decoding import SpaceNetRegressor
penalties = ["smooth-lasso", "tv-l1"]
decoders = {}
for penalty in penalties:
    decoder = SpaceNetRegressor(mask=mask_img, penalty=penalty,
                                eps=1e-1,  // prefer large alphas
                                memory="cache", verbose=2)
    decoder.fit(X, y)  // fit
    decoders[penalty] = decoder


////// Visualization //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
import matplotlib.pyplot as plt
from nilearn.plotting import plot_stat_map
from nilearn.image import mean_img
for penalty, decoder in decoders.iteritems():

After Change


////// Fit Smooth-Lasso ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
penalty = "smooth-lasso"
from nilearn.decoding import SpaceNetRegressor
decoder = SpaceNetRegressor(mask=mask_img, penalty=penalty,
                            eps=1e-1,  // prefer large alphas
                            memory="cache", verbose=2)
decoder.fit(X, y)  // fit

////// Visualize Smooth-Lasso weights
import matplotlib.pyplot as plt
from nilearn.plotting import plot_stat_map
from nilearn.image import mean_img
plot_stat_map(mean_img(decoder.coef_img_), title=penalty, display_mode="yz",
              cut_coords=[20, -2])


////// Fit TV-L1 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
penalty = "tv-l1"
decoder = SpaceNetRegressor(mask=mask_img, penalty=penalty,
                            eps=1e-1,  // prefer large alphas
                            memory="cache", verbose=2)
decoder.fit(X, y)  // fit

////// Visualize TV-L1 weights
plot_stat_map(mean_img(decoder.coef_img_), title=penalty, display_mode="yz",
              cut_coords=[20, -2])

plt.show()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 12

Instances


Project Name: nilearn/nilearn
Commit Name: 49257721ec65c78965df63152b8933e9baebd4a6
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: examples/decoding/plot_poldrack_space_net.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 98c59811ac8ac88362b6118794b598ed92682eb7
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: examples/decoding/plot_poldrack_space_net.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 49257721ec65c78965df63152b8933e9baebd4a6
Time: 2015-07-28
Author: elvis.dohmatob@inria.fr
File Name: examples/decoding/plot_poldrack_space_net.py
Class Name:
Method Name:


Project Name: nilearn/nilearn
Commit Name: 311ac284d99ea7243e0918949f3a499a7a93fab5
Time: 2015-11-29
Author: gael.varoquaux@normalesup.org
File Name: examples/decoding/plot_haxby_space_net.py
Class Name:
Method Name: