rsatoolbox.rdm.combine module

Functions operating on a set of related RDMs objects

rsatoolbox.rdm.combine.from_partials(list_of_rdms: List[RDMs], all_patterns: List[str] | None = None, descriptor: str = 'conds') RDMs[source]

Make larger RDMs with missing values where needed

Any object-level descriptors will be turned into rdm_descriptors if they do not match across objects.

Parameters:
  • list_of_rdms (list) – List of RDMs objects

  • all_patterns (list, optional) – The full list of pattern descriptors. Defaults to None, in which case the full list is the union of all input rdms’ values for the pattern descriptor chosen.

  • descriptor (str, optional) – The pattern descriptor on the basis of which to expand. Defaults to ‘conds’.

Returns:

Object containing all input rdms on the larger scale,

with missing values where required

Return type:

RDMs

rsatoolbox.rdm.combine.rescale(rdms, method: str = 'evidence', threshold=1e-08)[source]

Bring RDMs closer together

Iteratively scales RDMs based on pairs in-common. Also adds an RDM descriptor with the weights used.

Parameters:
  • method (str, optional) – One of ‘evidence’, ‘setsize’ or ‘simple’. Defaults to ‘evidence’.

  • threshold (float) – Stop iterating when the sum of squares difference between iterations is smaller than this value. A smaller value means more iterations, but the algorithm may not always converge.

Returns:

RDMs object with the aligned RDMs

Return type:

RDMs