Multivariate Pattern Analysis in Python

# mvpa2.algorithms.searchlight_hyperalignment.SearchlightHyperalignment

class `mvpa2.algorithms.searchlight_hyperalignment.``SearchlightHyperalignment`(**kwargs)

  Given a list of datasets, provide a list of mappers into common space using searchlight based hyperalignment. Guntupalli et al., Cerebral Cortex (2016)

  1) Input datasets should all be of the same size in terms of nsamples and nfeatures, and be coarsely aligned (using anatomy). 2) All features in all datasets should be zscored. 3) Datasets should have feature attribute `voxel_indices` containing spatial coordinates of all features

  Attributes

  `descr` | Description of the object if any

  Methods

  `__call__`(datasets) | Estimate mappers for each dataset using searchlight-based hyperalignment.
  `reset`() |

  Initialize instance of SearchlightHyperalignment

  Parameters:

  ref_ds : int, optional

  > Index of a dataset to use as a reference. First dataset is used as default. If you supply exclude_from_model list, you should supply the ref_ds index as index before you remove those excluded datasets. Note that unlike regular Hyperalignment, there is no automagic choosing of the “best” ref_ds by default. Constraints: value must be convertible to type ‘int’, and value must be in range [0, inf]. [Default: 0]

  queryengine

  > A single (or a list of query engines, one per each dataset) to be used. If not provided, volumetric searchlight, with spherical neighborhood as instructed by radius parameter will be used. [Default: None]

  radius : int, optional

  > Radius of a searchlight sphere in number of voxels to be used if no `queryengine` argument was provided. Constraints: value must be convertible to type ‘int’, and value must be in range [1, inf]. [Default: 3]

  nproc : int or None, optional

  > Number of cores to use. Constraints: (value must be convertible to type ‘int’, and value must be in range [1, inf]), or value must be `None`. [Default: 1]

  nblocks : int or None, optional

  > Number of blocks to divide to process. Higher number results in smaller memory consumption. Constraints: (value must be convertible to type ‘int’, and value must be in range [1, inf]), or value must be `None`. [Default: None]

  sparse_radius : int or None, optional

  > Radius supplied to scatter_neighborhoods in units of voxels. This is effectively the distance between the centers where hyperalignment is performed in searchlights. ATM applicable only if no custom queryengine was provided. If None, hyperalignment is performed at every voxel (default). Constraints: (value must be in range [1, inf], and value must be convertible to type ‘int’), or value must be `None`. [Default: None]

  hyperalignment

  > Hyperalignment instance to be used in each searchlight sphere. Default is just the Hyperalignment instance with default parameters. Its `ref_ds` parameter would be overridden by the `ref_ds` parameter of this SearchlightHyperalignment instance because we want to be consistent and only need one `ref_ds`. [Default: Hyperalignment(alpha=1.0)]

  combine_neighbormappers : bool, optional

  > This param determines whether to combine mappers for each voxel from its neighborhood searchlights or just use the mapper for which it is the center voxel. This will not be applicable for certain queryengines whose ids and neighborhoods are from different spaces, such as for SurfaceVerticesQueryEngine. Constraints: value must be convertible to type bool. [Default: True]

  compute_recon : bool, optional

  > This param determines whether to compute reverse mappers for each subject from common-space to subject space. These will be stored in the StaticProjectionMapper() and used when reverse() is called. Enabling it will double the size of the mappers returned. Constraints: value must be convertible to type bool. [Default: True]

  featsel : float or int, optional

  > Determines if feature selection will be performed in each searchlight. 1.0: Use all features. < 1.0 is understood as selecting that proportion of features in each searchlight of ref_ds using feature scores; > 1.0 is understood as selecting at most that many features in each searchlight. Constraints: (value must be convertible to type ‘float’, and value must be in range [0.0, 1.0]), or (value must be convertible to type ‘int’, and value must be in range [2, inf]). [Default: 1.0]

  use_same_features : bool, optional

  > Select the same (best) features when doing feature selection for all datasets. Constraints: value must be convertible to type bool. [Default: False]

  exclude_from_model : list(int), optional

  > List of dataset indices that will not participate in building common model. These will still get mappers back but they don’t influence the model or voxel selection. Constraints: value must be convertible to list(int). [Default: []]

  mask_node_ids : list(int) or None, optional

  > You can specify a mask to compute searchlight hyperalignment only within this mask. These would be a list of voxel indices. Constraints: value must be convertible to list(int), or value must be `None`. [Default: None]

  dtype : str, optional

  > dtype of elements transformation matrices to save on memory for big datasets. Constraints: value must be a string. [Default: ‘float32’]

  results_backend : {hdf5, native}, optional

  > ‘hdf5’ or ‘native’. See Searchlight documentation. Constraints: value must be one of (‘hdf5’, ‘native’). [Default: ‘hdf5’]

  tmp_prefix : str, optional

  > Prefix for temporary files. See Searchlight documentation. Constraints: value must be a string. [Default: ‘tmpsl’]

  descr : str

  > Description of the instance

  Attributes

  `descr` | Description of the object if any

  Methods

  `__call__`(datasets) | Estimate mappers for each dataset using searchlight-based hyperalignment.
  `reset`() |