Module Reference

This module reference extends the manual with a comprehensive overview of the currently available functionality, that is built into PyMVPA. However, instead of a full list including every single line of the PyMVPA code base, this reference limits itself to the relevant pieces of the application programming interface (API) that are of particular interest to users of this framework.

Each module in the package is documented by a general summary of its purpose and the list of classes and functions it provides.

Entry Point

mvpa2 Framework for multivariate pattern analysis (MVPA)

Basic Facilities

base Plumbing layer for PyMVPA
base.attributes Module with some special objects to be used as magic attributes with dedicated containers aka.
base.collections Module with some special objects to be used as magic attributes with dedicated containers aka.
base.config Registry-like monster
base.constraints Helper for parameter validation, documentation and conversion
base.dochelpers Various helpers to improve docstrings and textual output
base.externals Helper to verify presence of external libraries and modules
base.hdf5 HDF5-based file IO for PyMVPA objects.
base.info Provide system and PyMVPA information useful while reporting bugs
base.learner Implementation of a common trainable processing object (Learner).
base.node Implementation of a common processing object (node).
base.param Parameter representation
base.progress Helper to print pretty progress indicator.
base.report Creating simple PDF reports using reportlab
base.state Classes to control and store state information.
base.types Things concerned with types and type-checking in PyMVPA
base.verbosity Verbose output and debugging facility

Datasets: Input, Output, Storage and Preprocessing

base.dataset Multi-purpose dataset container with support for attributes.
datasets.base PyMVPA’s common Dataset container.
datasets.channel Dataset handling data structured in channels.
datasets.eventrelated Functions for event segmentation or modeling of dataset.
datasets.eep Support for the binary EEP file format for EEG data
datasets.formats Support for commonly used data source formats.
datasets.gifti Support for surface-based GIFTI data IO.
datasets.mri Support for magnetic resonance imaging (MRI) data IO.
datasets.niml Support for storage using the NeuroImaging Markup Language (NIML).
datasets.cosmo Dataset from CoSMoMVPA
datasets.eeglab Support for EEGLAB’s electrode-time series text file format.
datasets.miscfx Miscellaneous functions to perform operations on datasets.
datasets.sources Datasets originating from code outside of PyMVPA
datasets.sources.native Loaders for PyMVPA’s own demo datasets
datasets.sources.bids I/O support for neuroimaging dataset in BIDS_ format
datasets.sources.openfmri Helpers to build PyMVPA dataset instances from openfmri.org dataset
datasets.sources.skl_data Wrapper for sklearn datasets/data generators.

Mappers: Data Transformations

mappers Algorithms for (reversible) data transformation.
mappers.base Basic, general purpose and meta mappers.
mappers.boxcar Transform consecutive samples into individual multi-dimensional samples
mappers.detrend Polynomial de-trending and regression.
mappers.filters Spectral filtering and FFT-based resampling.
mappers.flatten Flatten multi-dimensional samples
mappers.fx Transform data by applying a function along samples or feature axis.
mappers.fxy Evaluate functions on pairs of datasets
mappers.glm Transform datasets into parameter estimates of a general linear model fit.
mappers.lle Local Linear Embedding.
mappers.mdp_adaptor Wrapper to use MDP nodes and flows as PyMVPA mappers.
mappers.procrustean Procrustean rotation mapper
mappers.projection Base class for mappers doing linear transformations
mappers.prototype Project data onto a space defined by prototypes via a similarity function
mappers.shape Basic dataset shape modifications.
mappers.skl_adaptor Use scikit-learn transformer as mappers.
mappers.slicing Collection of dataset slicing procedures.
mappers.som Self-organizing map (SOM).
mappers.staticprojection Transform data via static projection matrices
mappers.svd Singular-value decomposition
mappers.wavelet Wavelet transformation
mappers.zscore Data normalization by Z-Scoring.

Generators: Repetitive Data Processing

generators Generate multiple output datasets form a single input
generators.base Repeat and filter as sequence of dataset
generators.partition Dataset partitioning strategies
generators.permutation Generator nodes to permute datasets.
generators.resampling Dataset content resampling (e.g.
generators.splitters Split a single input dataset into multiple parts

Classifiers and Errors

clfs.base Plumbing for all learners (classifiers and regressions)
clfs.meta Meta classifiers – classifiers which use other classifiers or preprocessing
clfs.blr Bayesian Linear Regression (BLR).
clfs.enet Elastic-Net (ENET) regression classifier.
clfs.gda Gaussian Discriminant Analyses: LDA and QDA
clfs.glmnet GLM-Net (GLMNET) regression and classifier.
clfs.gnb Gaussian Naive Bayes Classifier
clfs.gpr Gaussian Process Regression (GPR).
clfs.knn k-Nearest-Neighbour classifier.
clfs.lars Least angle regression (LARS).
clfs.mass Generic wrappers for learners (classifiers) provided by R’s MASS
clfs.model_selector Model selction.
clfs.plr Penalized logistic regression classifier.
clfs.ridge Ridge regression classifier.
clfs.similarity Similarity functions for prototype-based projection.
clfs.skl Classifiers provided by scikit-learn (skl) library
clfs.smlr Sparse Multinomial Logistic Regression classifier.
clfs.svm Importer for the available SVM and SVR machines.
clfs.sg Classifiers provided by shogun (sg) library
clfs.libsvmc Classifiers provided by LibSVM library
clfs.distance Distance functions to be used in kernels and elsewhere
clfs.similarity Similarity functions for prototype-based projection.
clfs.stats Estimator for classifier error distributions.
clfs.transerror Utility class to compute the transfer error of classifiers.
clfs.warehouse Collection of classifiers to ease the exploration.

Kernels

kernels Import helper for PyMVPA kernels/similarities and alike
kernels.base Base Kernel classes
kernels.libsvm PyMVPA LibSVM-based kernels
kernels.np Kernels for Gaussian Process Regression and Classification.
kernels.sg PyMVPA shogun-based kernels

Measures: Searchlights and Sensitivties

measures.base Plumbing for measures: algorithms that quantify properties of datasets.
measures.anova Univariate ANOVA
measures.corrstability Stability of labels across chunks based on correlation.
measures.corrcoef FeaturewiseMeasure of correlation with the labels.
measures.irelief Multivariate Iterative RELIEF
measures.noiseperturbation Derive sensitivity maps for a metric by selective noise perturbation
measures.gnbsearchlight An efficient implementation of searchlight for GNB.
measures.nnsearchlight An efficient implementation of searchlight for M1NN.
measures.rsa Representational (dis)similarity analysis
measures.searchlight Searchlight implementation for arbitrary measures and spaces
measures.statsmodels_adaptor Wrap models of the StatsModels package into a FeaturewiseMeasure.
measures.winner Data aggregation procedures

Feature Selection

featsel.base Feature selection base class and related stuff base classes and helpers.
featsel.ifs Incremental feature search (IFS).
featsel.rfe Recursive feature elimination.
featsel.helpers Helpers for feature selection (scoring, selection strategies)

Additional Algorithms

algorithms Import helper for PyMVPA algorithms.
algorithms.hyperalignment Transformation of individual feature spaces into a common space
algorithms.searchlight_hyperalignment Searchlight-based hyperalignment
algorithms.group_clusterthr Cluster thresholding algorithm for a group-level searchlight analysis

Algorithm benchmarks

algorithms.benchmarks Benchmarks for various analyses
algorithms.benchmarks.hyperalignment Benchmarks for hyperalignment algorithms

Miscellaneous

atlases Import helper for PyMVPA anatomical atlases
atlases.base Base classes for Anatomy atlases support
atlases.fsl FSL atlases interfaces
atlases.warehouse Collection of the known atlases
misc.args Helpers for arguments handling.
misc.attrmap Helper to map literal attribute to numerical ones (and back)
misc.data_generators Miscellaneous data generators for unittests and demos
misc.dcov Compute dcov/dcorr measures for independence testing
misc.errorfx Error functions helpers.
misc.exceptions Exception classes which might get thrown
misc.fx Misc.
misc.neighborhood Neighborhood objects
misc.sampleslookup Helper to map and validate samples’ origids into indices
misc.stats Little statistics helper
misc.support Support function – little helpers in everyday life
misc.support.afni
misc.surfing Import helper for surfing (surface-based information mapping)
misc.surfing.queryengine QueryEngine for querying feature ids based on the surface nodes
misc.surfing.surf_voxel_selection Functionality for surface-based voxel selection
misc.surfing.volgeom Volume geometry to map between world and voxel coordinates.
misc.surfing.volsurf Associate volume geometry with two surface meshes (typically pial and white matter boundaries of the grey matter).
misc.surfing.volume_mask_dict Dictionary (mapping) for storing several volume masks.
misc.transformers Simply functors that transform something.
misc.vproperty C++-like virtual properties
support.bayes Bayes (BayesConfusionHypothesis) support code

Testing

testing Helpers to unify/facilitate unittesting within PyMVPA
testing.clfs Provides clfs dictionary with instances of all available classifiers.
testing.datasets Provides convenience datasets for unittesting.
testing.tools A Collection of tools found useful in unittests.
testing.sweepargs(\*\*kwargs) Decorator function to sweep over a given set of classifiers
tests Unit test interface for PyMVPA

Basic Plotting Utilities

viz Visualization of datasets
misc.plot Import helper for miscellaneous PyMVPA plotting functions (mvpa2.misc.plot)
misc.plot.base Misc.
misc.plot.erp Basic ERP (here ERP = Event Related Plot ;-)) plotting
misc.plot.flat_surf Plot flat maps of cortical surfaces.
misc.plot.lightbox Basic (f)MRI plotting with ability to interactively perform thresholding
misc.plot.topo Plot parameter distributions on a head surface (topography plots).
misc.plot.scatter Routines to scatterplot data

3rd-party Interfaces

misc.bv Import helper for Brain Voyager
misc.bv.base Tiny snippets to interface with FSL easily.
misc.fsl Import helper for FSL
misc.fsl.base Tiny snippets to interface with FSL easily.
misc.fsl.flobs Wrapper around FSLs halfcosbasis to generate HRF kernels
misc.fsl.melodic Wrapper around the output of MELODIC (part of FSL)
misc.io Import helper for IO helpers
misc.io.base Some little helper for reading (and writing) common formats from and to disk.
misc.io.meg IO helper for MEG datasets.
support.nibabel AFNI/SUMA file format I/O functions
support.nibabel.afni_niml_annot Experimental support for AFNI NIML annotation files
support.nibabel.afni_niml_dset AFNI NIML dataset I/O support.
support.nibabel.afni_niml_roi AFNI NIML ROI (region of interest) read support
support.nibabel.afni_niml General AFNI NIML I/O support
support.nibabel.afni_suma_1d Very simple AFNI 1D support
support.nibabel.afni_suma_spec Support for ANFI SUMA surface specification (.spec) files
support.nibabel.surf_fs_asc Simple FreeSurfer ASCII surface file I/O functions
support.nibabel.surf_caret Caret binary file support
support.nibabel.surf_gifti GIFTI surface functions (wrapper) using nibabel.gifti
support.nibabel.surf General support for cortical surface meshes