Multivariate Pattern Analysis in Python

# Tutorial Introduction to PyMVPA

In this tutorial we are going to take a look at all major parts of PyMVPA, introduce the most important concepts, and explore particular functionality in real-life analysis examples. This tutorial also serves as basic course material for workshops on introductions to MVPA. Please contact us, if you are interested in hosting a PyMVPA workshop at your institution.

Please note that this tutorial is only concerned with aspects directly related to PyMVPA. It does not teach basic Python programming. If you are new to Python, we recommend that you take a look at the Tutorial Prerequisites for information about what you should know and how to obtain that knowledge.

Throughout the tutorial there will be little exercises with tasks that aim to deepen your understanding of a particular problem or to train important skills. However, even without a dedicated exercise you are advised to run the tutorial code interactively and explore code snippets beyond what is touched by the tutorial. Typically, only the most important aspects will be mentioned and each building block in PyMVPA can be used in more flexible ways than what is shown. Enjoy the ride.

Throughout the tutorial we will analyze real BOLD fMRI data. Therefore, to be able to run the code in this tutorial, you need to download the corresponding data from the PyMVPA website. Once downloaded, extract the tarball. On a NeuroDebian-enabled system, the tutorial data is also available from the `python-mvpa2-tutorialdata` package.

The `pymvpa2-tutorial` command (installed with PyMVPA) can be invoked in a console in order to launch a tutorial session. If the tutorial data was downloaded manually it may be necessary to specify the appropriate `--tutorial-data-path` option (see `pymvpa2-tutorial --help` for more information).

Virtually every Python script starts with some `import` statements that load functionality provided elsewhere. Likewise a tutorial session needs to import the PyMVPA packages and some little helpers we are going to use in the tutorial:

    >>> from mvpa2.tutorial_suite import *

If this command succeeds without error, everything is ready to go.

If you want to prevent yourself from re-typing all code snippets into the terminal window, you might want to investigate IPython’s `%cpaste` command, or use the `IPython notebooks`_ provided for each tutorial part.

- Tutorial Prerequisites
  - What Do I Need To Get Python Running
  - Recommended Reading and Viewing
- Dataset basics and concepts
  - Attributes
  - Slicing, resampling, feature selection
  - Load fMRI data
  - Intermediate storage
- Getting data in shape
  - Load real data
  - More structure, less duplication of work
  - Basic preprocessing
  - There and back again – a Mapper’s tale
- Classifiers – All Alike, Yet Different
  - Cross-validation
  - Any classifier, really
  - We Need To Take A Closer Look
- Looking here and there – Searchlights
  - Measures
  - Searching, searching, searching, ...
  - For real!
- Classifiers that do more – Meta Classifiers
- Classification Model Parameters – Sensitivity Analysis
  - It’s A Kind Of Magic
  - Thanks For The Fish
  - Dissect The Classifier
  - Closing Words
- Event-related Data Analysis
  - Event-related Pre-processing Is Not Event-related
  - Design Specification
  - Response Modeling
  - From Timeseries To Spatio-temporal Samples
  - A Plotting Example
- Multi-dimensional Searchlights
- Working with OpenFMRI.org data
- WiP: The Earth Is Round – Significance Testing
  - Null hypothesis testing
  - The following content is incomplete and experimental
  - Evaluating multi-class classifications
  - Previously in part 8
  - Statistical Tools in Python
  - Dataset Exploration for Confounds
  - Hypothesis Testing
  - Statistical Treatment of Sensitivities
  - References