.. -*- mode: rst; fill-column: 78 -*-
.. ex: set sts=4 ts=4 sw=4 et tw=79:
  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###
  #
  #   See COPYING file distributed along with the PyMVPA package for the
  #   copyright and license terms.
  #
  ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ###

.. _examples:

.. index:: example

********
Examples
********

Each of the following examples is a stand-alone script containing all
necessary code to run some analysis. All examples are shipped with PyMVPA and
can be found in the `doc/examples/` directory in the source package. This
directory include some more special-interest examples which are not listed
here.

Some examples need to access sample dataset available under `data/` directory
within root of PyMVPA hierarchy, thus they have to be invoked directly from
PyMVPA root (e.g. `doc/examples/searchlight_2d.py`).

.. index:: plotting

Simple Plotting of Classifier Behavior
======================================

This example runs a number of classifiers on a simple dataset and plots the
decision surface of each classifier.

.. literalinclude:: examples/pylab_2d.py

.. _example_searchlight:


.. index:: searchlight

Easy Searchlight
================

Run a searchlight analysis on the example fMRI dataset that is shipped with
PyMVPA. This example is part of the PyMVPA source distribution:
doc/examples/searchlight_2d.py`.

.. literalinclude:: examples/searchlight_2d.py


.. index:: sensitivity

Sensitivity Measure
===================

Run some basic and meta sensitivity measures on the example fMRI dataset that
comes with PyMVPA and plot the computed featurewise measures for each.

.. literalinclude:: examples/sensanas.py


.. index:: mapper, SVD, MappedClassifier

Classification of SVD-mapped Datasets
=====================================

Demonstrate the usage of a dataset mapper performing singular value
decomposition within a cross-validation.

.. literalinclude:: examples/svdclf.py


.. index:: SMLR, SVM

Compare SMLR to Linear SVM Classifier
=====================================

Runs both classifiers on the the same dataset and compare their performance.
This example also shows an example usage of confusion matrices and how two
classifers can be combined.

.. literalinclude:: examples/smlr.py


