-
Notifications
You must be signed in to change notification settings - Fork 12
/
going_further.html
446 lines (408 loc) · 26.6 KB
/
going_further.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="2.6. Running scikit-learn functions for more control on the analysis" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://nilearn.github.io/decoding/going_further.html" />
<meta property="og:site_name" content="Nilearn" />
<meta property="og:description" content="This section gives pointers to design your own decoding pipelines with scikit-learn. This builds on the didactic introduction to decoding. Contents: Performing decoding with scikit-learn, Going fur..." />
<meta property="og:image" content="https://nilearn.github.io/_static/nilearn-logo.png" />
<meta property="og:image:alt" content="Nilearn" />
<title>Nilearn: Statistical Analysis for NeuroImaging in Python — Machine learning for NeuroImaging</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/nature.css" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery.css" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-dataframe.css" />
<link rel="stylesheet" type="text/css" href="../_static/sg_gallery-rendered-html.css" />
<script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/clipboard.min.js"></script>
<script src="../_static/copybutton.js"></script>
<link rel="shortcut icon" href="../_static/favicon.ico"/>
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="3. Functional connectivity and resting state" href="../connectivity/index.html" />
<link rel="prev" title="2.5. Searchlight : finding voxels containing information" href="searchlight.html" />
<meta content="True" name="HandheldFriendly">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="keywords" content="nilearn, neuroimaging, python, neuroscience, machinelearning">
<script type="text/javascript">
function updateTopMenuPosition(height, width) {
if($(window).scrollTop() > height && $(window).outerWidth() > 1024) {
//begin to scroll
$('.related-wrapper').css("z-index", 1000);
$('.related-wrapper').css("position", "sticky");
$('.related-wrapper').css("top", 0);
$('.related-wrapper').css("width", width)
} else {
//lock it back into place
$('.related-wrapper').css("position", "relative");
$('.related-wrapper').css("top", 0)
}
}
$(function() {
var banner_height = $('#logo-banner').outerHeight();
var banner_width = $('#logo-banner').outerWidth();
var width = $('.related-wrapper').css("height", $('.related').outerHeight());
updateTopMenuPosition(banner_height, width);
$(window).scroll(function(event) {
updateTopMenuPosition(banner_height, width)
});
$(window).resize(function(event) {
var banner_width = $('#logo-banner').outerWidth();
var menu_height = $('.related').outerHeight();
$('.related').css("width", banner_width);
$('.related-wrapper').css("height", menu_height);
updateTopMenuPosition(banner_height, width)
})
});
</script>
<script type="text/javascript">
function updateSideBarPosition(top, offset, sections) {
var pos = $(window).scrollTop();
// Lock the table of content to a fixed position once we scroll enough
var topShift = 2 * offset;
if(pos > top + topShift + 1) {
// begin to scroll with sticky menu bar
var topShift = -topShift + 1;
if ($(window).outerWidth() < 1024) {
// compensate top menu that disappears
topShift -= offset + 1
}
$('.sphinxsidebarwrapper').css("position", "fixed");
$('.sphinxsidebarwrapper').css("top", topShift)
}
else {
//lock it back into place
$('.sphinxsidebarwrapper').css("position", "relative");
$('.sphinxsidebarwrapper').css("top",0)
}
// Highlight the current section
i = 0;
current_section = 0;
$('a.internal').removeClass('active');
for(i in sections) {
if(sections[i] > pos) {
break
}
if($('a.internal[href$="' + i + '"]').is(':visible')){
current_section = i
}
}
$('a.internal[href$="' + current_section + '"]').addClass('active');
$('a.internal[href$="' + current_section + '"]').parent().addClass('active')
}
$(function () {
// Lock the table of content to a fixed position once we scroll enough
var tocOffset = $('.related-wrapper').outerHeight();
var marginTop = parseFloat($('.sphinxsidebarwrapper').css('margin-top').replace(/auto/, 0));
var top = $('.sphinxsidebarwrapper').offset().top - marginTop;
sections = {};
url = document.URL.replace(/#.*$/, "");
// Grab positions of our sections
$('.headerlink').each(function(){
sections[this.href.replace(url, '')] = $(this).offset().top - 50
});
updateSideBarPosition(top, tocOffset, sections);
$(window).scroll(function(event) {
updateSideBarPosition(top, tocOffset, sections)
});
$(window).resize(function(event) {
tocOffset = $('.related-wrapper').outerHeight();
updateSideBarPosition(top, tocOffset, sections)
});
});
</script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-41920728-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head><body>
<div id="logo-banner">
<div class="logo">
<a href="../index.html">
<img src="../_static/nilearn-logo.png" alt="Nilearn logo" border="0" />
</a>
</div>
<!-- A tag cloud to make it easy for people to find what they are
looking for -->
<div class="tags">
<ul>
<li>
<big><a href="../auto_examples/decoding/plot_haxby_anova_svm.html">SVM</a></big>
</li>
<li>
<small><a href="../connectivity/parcellating.html">Ward
clustering</a></small>
</li>
<li>
<a href="searchlight.html">Searchlight</a>
</li>
<li>
<big><a href="../connectivity/resting_state_networks.html">ICA</a></big>
</li>
<li>
<a href="../manipulating_images/data_preparation.html">Nifti IO</a>
</li>
<li>
<a href="../modules/reference.html#module-nilearn.datasets">Datasets</a>
</li>
</ul>
</div>
<div class="banner">
<h1>Nilearn:</h1>
<h2>Statistics for NeuroImaging in Python</h2>
</div>
<div class="search_form">
<div class="gcse-search" id="cse" style="width: 100%;"></div>
<script>
(function() {
var cx = '017289614950330089114:elrt9qoutrq';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
</div>
</div>
<div class=related-wrapper>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../py-modindex.html" title="Python Module Index"
>modules</a></li>
<li class="right" >
<a href="../connectivity/index.html" title="3. Functional connectivity and resting state"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="searchlight.html" title="2.5. Searchlight : finding voxels containing information"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">Nilearn Home</a> | </li>
<li><a href="../user_guide.html">User Guide</a> | </li>
<li><a href="../auto_examples/index.html">Examples</a> | </li>
<li><a href="../modules/reference.html">Reference</a> | </li>
<li id="navbar-about"><a href="../authors.html">About</a>| </li>
<li><a href="../glossary.html">Glossary</a>| </li>
<li><a href="../bibliography.html">Bibliography</a>| </li>
<li id="navbar-ecosystem"><a href="http://www.nipy.org/">Nipy ecosystem</a></li>
<li class="nav-item nav-item-1"><a href="../user_guide.html" >User guide: table of contents</a> »</li>
<li class="nav-item nav-item-2"><a href="index.html" accesskey="U"><span class="section-number">2. </span>Decoding and MVPA: predicting from brain images</a> »</li>
<li class="nav-item nav-item-this"><a href="">Nilearn: Statistical Analysis for NeuroImaging in Python</a></li>
</ul>
</div>
</div>
<div class="stable-banner">
This is the <em>stable</em> documentation for the latest release of Nilearn,
the current development version is available <a href="https://nilearn.github.io/dev/index.html">here</a>.
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="running-scikit-learn-functions-for-more-control-on-the-analysis">
<span id="going-further"></span><h1><span class="section-number">2.6. </span>Running scikit-learn functions for more control on the analysis<a class="headerlink" href="#running-scikit-learn-functions-for-more-control-on-the-analysis" title="Permalink to this headline">¶</a></h1>
<p>This section gives pointers to design your own decoding pipelines with
scikit-learn. This builds on the <a class="reference internal" href="decoding_intro.html#decoding-intro"><span class="std std-ref">didactic introduction to decoding</span></a>.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This documentation gives links and additional definitions needed to work
correctly with scikit-learn. For a full code example, please check out: <a class="reference internal" href="../auto_examples/07_advanced/plot_advanced_decoding_scikit.html#sphx-glr-auto-examples-07-advanced-plot-advanced-decoding-scikit-py"><span class="std std-ref">Advanced decoding using scikit learn</span></a></p>
</div>
<div class="contents local topic" id="contents">
<p class="topic-title"><strong>Contents</strong></p>
<ul class="simple">
<li><p><a class="reference internal" href="#performing-decoding-with-scikit-learn" id="id1">Performing decoding with scikit-learn</a></p></li>
<li><p><a class="reference internal" href="#going-further-with-scikit-learn" id="id2">Going further with scikit-learn</a></p></li>
<li><p><a class="reference internal" href="#setting-estimator-parameters" id="id3">Setting estimator parameters</a></p></li>
</ul>
</div>
<div class="section" id="performing-decoding-with-scikit-learn">
<h2><a class="toc-backref" href="#id1"><span class="section-number">2.6.1. </span>Performing decoding with scikit-learn</a><a class="headerlink" href="#performing-decoding-with-scikit-learn" title="Permalink to this headline">¶</a></h2>
<div class="section" id="using-scikit-learn-estimators">
<h3><span class="section-number">2.6.1.1. </span>Using scikit-learn estimators<a class="headerlink" href="#using-scikit-learn-estimators" title="Permalink to this headline">¶</a></h3>
<p>You can easily import estimators from the <a class="reference external" href="http://scikit-learn.org">scikit-learn</a> machine-learning library, those available in the <cite>Decoder</cite> object and many others.
They all have the <cite>fit</cite> and <cite>predict</cite> functions. For example you can directly import the versatile <a class="reference external" href="http://scikit-learn.org/stable/modules/svm.html">Support Vector Classifier</a> (or SVC).</p>
<p>To learn more about the variety of classifiers available in scikit-learn, see the <a class="reference external" href="http://scikit-learn.org/stable/supervised_learning.html">scikit-learn documentation on supervised learning</a>.</p>
</div>
<div class="section" id="cross-validation-with-scikit-learn">
<h3><span class="section-number">2.6.1.2. </span>Cross-validation with scikit-learn<a class="headerlink" href="#cross-validation-with-scikit-learn" title="Permalink to this headline">¶</a></h3>
<p>To perform cross-validation using a scikit-learn estimator, you should first
mask the data using a <a class="reference internal" href="../modules/generated/nilearn.maskers.NiftiMasker.html#nilearn.maskers.NiftiMasker" title="nilearn.maskers.NiftiMasker"><code class="xref py py-class docutils literal notranslate"><span class="pre">nilearn.maskers.NiftiMasker</span></code></a>: to extract
only the <a class="reference internal" href="../glossary.html#term-voxel"><span class="xref std std-term">voxels</span></a> inside the mask of interest, and transform 4D input <a class="reference internal" href="../glossary.html#term-fMRI"><span class="xref std std-term">fMRI</span></a>
data to 2D arrays (shape (n_timepoints, n_voxels)) that estimators can work on.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>This example shows how to use masking:
<a class="reference internal" href="../auto_examples/06_manipulating_images/plot_nifti_simple.html#sphx-glr-auto-examples-06-manipulating-images-plot-nifti-simple-py"><span class="std std-ref">Simple example of NiftiMasker use</span></a></p>
</div>
<p>Then use a specific function <a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.cross_val_score.html#sklearn.model_selection.cross_val_score" title="(in scikit-learn v1.0)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sklearn.model_selection.cross_val_score</span></code></a>
that computes for you the score of your model for the different folds
of cross-validation.</p>
<p>You can change many parameters of the cross_validation here, for example:</p>
<ul class="simple">
<li><p>use a different cross-validation scheme, for example <a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.LeaveOneGroupOut.html#sklearn.model_selection.LeaveOneGroupOut" title="(in scikit-learn v1.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">sklearn.model_selection.LeaveOneGroupOut</span></code></a>.</p></li>
<li><p>speed up the computation by using <cite>n_jobs=-1</cite>, which will spread the computation equally across all processors.</p></li>
<li><p>use a different scoring function, as a keyword or imported from scikit-learn such as <cite>scoring=’roc_auc’</cite>.</p></li>
</ul>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<ul class="simple">
<li><p>If you need more than only than cross-validation scores (i.e the predictions
or models for each fold) or if you want to learn more on various cross-validation schemes,
see <a class="reference external" href="https://scikit-learn.org/stable/modules/cross_validation.html">here</a>.</p></li>
<li><p><a class="reference external" href="http://scikit-learn.org/stable/modules/model_evaluation.html#common-cases-predefined-values">How to evaluate a model using scikit-learn</a>.</p></li>
</ul>
</div>
</div>
<div class="section" id="measuring-the-chance-level">
<h3><span class="section-number">2.6.1.3. </span>Measuring the chance level<a class="headerlink" href="#measuring-the-chance-level" title="Permalink to this headline">¶</a></h3>
<p><strong>Dummy estimators</strong>: The simplest way to measure prediction performance at chance is to use a <em>“dummy”</em> classifier: <a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.dummy.DummyClassifier.html#sklearn.dummy.DummyClassifier" title="(in scikit-learn v1.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">sklearn.dummy.DummyClassifier</span></code></a>.</p>
<p><strong>Permutation testing</strong>: A more controlled way, but slower, is to do permutation testing on the labels, with <a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.permutation_test_score.html#sklearn.model_selection.permutation_test_score" title="(in scikit-learn v1.0)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sklearn.model_selection.permutation_test_score</span></code></a>.</p>
<div class="topic">
<p class="topic-title"><strong>Decoding on simulated data</strong></p>
<p>Simple simulations may be useful to understand the behavior of a given
decoder on data. In particular, simulations enable us to set the true
weight maps and compare them to the ones retrieved by decoders. A full
example running simulations and discussing them can be found in
<a class="reference internal" href="../auto_examples/02_decoding/plot_simulated_data.html#sphx-glr-auto-examples-02-decoding-plot-simulated-data-py"><span class="std std-ref">Example of pattern recognition on simulated data</span></a>
Simulated data cannot easily mimic all properties of brain data. An
important aspect, however, is its spatial structure, that we create in
the simulations.</p>
</div>
</div>
</div>
<div class="section" id="going-further-with-scikit-learn">
<h2><a class="toc-backref" href="#id2"><span class="section-number">2.6.2. </span>Going further with scikit-learn</a><a class="headerlink" href="#going-further-with-scikit-learn" title="Permalink to this headline">¶</a></h2>
<p>We have seen a very simple analysis with scikit-learn, but your can easily add
intermediate processing steps if your analysis requires it. Some common
examples are :</p>
<ul class="simple">
<li><p>adding a feature selection step using scikit-learn pipelines</p></li>
<li><p>use any model available in scikit-learn (or compatible with) at any step</p></li>
<li><p>add more intermediate steps such as clustering</p></li>
</ul>
<div class="section" id="decoding-without-a-mask-anova-svm-using-scikit-learn">
<h3><span class="section-number">2.6.2.1. </span>Decoding without a mask: Anova-SVM using scikit-learn<a class="headerlink" href="#decoding-without-a-mask-anova-svm-using-scikit-learn" title="Permalink to this headline">¶</a></h3>
<p>We can also implement feature selection before decoding as a scikit-learn pipeline (<a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.pipeline.Pipeline.html#sklearn.pipeline.Pipeline" title="(in scikit-learn v1.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">sklearn.pipeline.Pipeline</span></code></a>).
For this, we need to import the <a class="reference external" href="https://scikit-learn.org/stable/modules/classes.html#module-sklearn.feature_selection" title="(in scikit-learn v1.0)"><code class="xref py py-mod docutils literal notranslate"><span class="pre">sklearn.feature_selection</span></code></a> module and use <a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.f_classif.html#sklearn.feature_selection.f_classif" title="(in scikit-learn v1.0)"><code class="xref py py-func docutils literal notranslate"><span class="pre">sklearn.feature_selection.f_classif</span></code></a>, a simple F-score based feature selection (a.k.a. <a class="reference external" href="https://en.wikipedia.org/wiki/Analysis_of_variance#The_F-test">Anova</a>),</p>
</div>
<div class="section" id="using-any-other-model-in-the-pipeline">
<h3><span class="section-number">2.6.2.2. </span>Using any other model in the pipeline<a class="headerlink" href="#using-any-other-model-in-the-pipeline" title="Permalink to this headline">¶</a></h3>
<p><a class="reference internal" href="../glossary.html#term-ANOVA"><span class="xref std std-term">Anova</span></a> - <a class="reference internal" href="../glossary.html#term-SVM"><span class="xref std std-term">SVM</span></a> is a good baseline that will give reasonable results
in common settings. However it may be interesting for you to explore the
<a class="reference external" href="http://scikit-learn.org/stable/supervised_learning.html">wide variety of supervised learning algorithms in the scikit-learn</a>. These can readily
replace the <a class="reference internal" href="../glossary.html#term-SVM"><span class="xref std std-term">SVM</span></a> in your pipeline and might be better fitted
to some usecases as discussed in the previous section.</p>
<p>The feature selection step can also be tuned. For example we could use a more
sophisticated scheme, such as <a class="reference external" href="http://scikit-learn.org/stable/modules/feature_selection.html#recursive-feature-elimination">Recursive Feature Elimination (RFE)</a>
or add some <a class="reference external" href="https://scikit-learn.org/stable/modules/clustering.html">a clustering step</a>
before feature selection. This always amount to creating
<a class="reference external" href="https://scikit-learn.org/stable/modules/compose.html">a pipeline</a> that will
link those steps together and apply a sensible cross-validation scheme to it.
Scikit-learn usually takes care of the rest for us.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<ul class="simple">
<li><p>The corresponding full code example to practice with pipelines <a class="reference internal" href="../auto_examples/07_advanced/plot_advanced_decoding_scikit.html#sphx-glr-auto-examples-07-advanced-plot-advanced-decoding-scikit-py"><span class="std std-ref">Advanced decoding using scikit learn</span></a></p></li>
<li><p>The <a class="reference external" href="http://scikit-learn.org">scikit-learn documentation</a> with detailed
explanations on a large variety of estimators and machine learning techniques.
To become better at decoding, you need to study it.</p></li>
</ul>
</div>
</div>
</div>
<div class="section" id="setting-estimator-parameters">
<h2><a class="toc-backref" href="#id3"><span class="section-number">2.6.3. </span>Setting estimator parameters</a><a class="headerlink" href="#setting-estimator-parameters" title="Permalink to this headline">¶</a></h2>
<p>Most estimators have parameters that can be set to optimize their
performance. Importantly, this must be done via <strong>nested</strong>
cross-validation.</p>
<p>Indeed, there is noise in the cross-validation score, and when we vary
the parameter, the curve showing the score as a function of the parameter
will have bumps and peaks due to this noise. These will not generalize to
new data and chances are that the corresponding choice of parameter will
not perform as well on new data.</p>
<p>With scikit-learn nested cross-validation is done via
<a class="reference external" href="https://scikit-learn.org/stable/modules/generated/sklearn.model_selection.GridSearchCV.html#sklearn.model_selection.GridSearchCV" title="(in scikit-learn v1.0)"><code class="xref py py-class docutils literal notranslate"><span class="pre">sklearn.model_selection.GridSearchCV</span></code></a>. It is unfortunately time
consuming, but the <code class="docutils literal notranslate"><span class="pre">n_jobs</span></code> argument can spread the load on multiple
CPUs.</p>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference external" href="https://scikit-learn.org/stable/tutorial/statistical_inference/model_selection.html">The scikit-learn documentation on choosing estimators and their parameters
selection</a></p>
</div>
</div>
</div>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4> Giving credit </h4>
<ul class="simple">
<li><p>Please consider <a href="../authors.html#citing">citing the
papers</a>.</p></li>
</ul>
<h3><a href="../index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">2.6. Running scikit-learn functions for more control on the analysis</a><ul>
<li><a class="reference internal" href="#performing-decoding-with-scikit-learn">2.6.1. Performing decoding with scikit-learn</a><ul>
<li><a class="reference internal" href="#using-scikit-learn-estimators">2.6.1.1. Using scikit-learn estimators</a></li>
<li><a class="reference internal" href="#cross-validation-with-scikit-learn">2.6.1.2. Cross-validation with scikit-learn</a></li>
<li><a class="reference internal" href="#measuring-the-chance-level">2.6.1.3. Measuring the chance level</a></li>
</ul>
</li>
<li><a class="reference internal" href="#going-further-with-scikit-learn">2.6.2. Going further with scikit-learn</a><ul>
<li><a class="reference internal" href="#decoding-without-a-mask-anova-svm-using-scikit-learn">2.6.2.1. Decoding without a mask: Anova-SVM using scikit-learn</a></li>
<li><a class="reference internal" href="#using-any-other-model-in-the-pipeline">2.6.2.2. Using any other model in the pipeline</a></li>
</ul>
</li>
<li><a class="reference internal" href="#setting-estimator-parameters">2.6.3. Setting estimator parameters</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="searchlight.html"
title="previous chapter"><span class="section-number">2.5. </span>Searchlight : finding voxels containing information</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="../connectivity/index.html"
title="next chapter"><span class="section-number">3. </span>Functional connectivity and resting state</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
© The nilearn developers 2010-2022.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 4.0.2.
<span style="padding-left: 5ex;">
<a href="../_sources/decoding/going_further.rst.txt"
rel="nofollow">Show this page source</a>
</span>
</div>
</body>
</html>