hypertools.tools.align

hypertools.tools.align(data, method='hyper', normalize=False, ndims=None)[source]

Aligns a list of arrays

This function takes a list of high dimensional arrays and ‘hyperaligns’ them to a ‘common’ space, or coordinate system following the approach outlined by Haxby et al, 2011. Hyperalignment uses linear transformations (rotation, reflection, translation, scaling) to register a group of arrays to a common space. This can be useful when two or more datasets describe an identical or similar system, but may not be in same coordinate system. For example, consider the example of fMRI recordings (voxels by time) from the visual cortex of a group of subjects watching the same movie: The brain responses should be highly similar, but the coordinates may not be aligned.

Haxby JV, Guntupalli JS, Connolly AC, Halchenko YO, Conroy BR, Gobbini MI, Hanke M, and Ramadge PJ (2011) A common, high-dimensional model of the representational space in human ventral temporal cortex. Neuron 72, 404 – 416.

Parameters:

data : list

A list of Numpy arrays or Pandas Dataframes

method : str

Either ‘hyper’ or ‘SRM’. If ‘hyper’ (default),

normalize : str or False

If set to ‘across’, the columns of the input data will be z-scored across lists (default). If set to ‘within’, the columns will be z-scored within each list that is passed. If set to ‘row’, each row of the input data will be z-scored. If set to False, the input data will be returned (default is False).

ndims : int

Number of dimensions to reduce the dataset to prior to alignment

Returns:

aligned : list

An aligned list of numpy arrays