rsatoolbox.rdm.transform module

transforms, which can be applied to RDMs

rsatoolbox.rdm.transform.positive_transform(rdms)[source]

sets all negative entries in an RDM to zero and returns a new RDMs

Parameters

rdms (RDMs) – RDMs object

Returns

RDMs object with sqrt transformed dissimilarities

Return type

rdms_new(RDMs)

rsatoolbox.rdm.transform.rank_transform(rdms, method='average')[source]

applies a rank_transform and generates a new RDMs object This assigns a rank to each dissimilarity estimate in the RDM, deals with rank ties and saves ranks as new dissimilarity estimates. As an effect, all non-diagonal entries of the RDM will range from 1 to (n_dim²-n_dim)/2, if the RDM has the dimensions n_dim x n_dim.

Parameters
  • rdms (RDMs) – RDMs object

  • method (String) – controls how ranks are assigned to equal values options are: ‘average’, ‘min’, ‘max’, ‘dense’, ‘ordinal’

Returns

RDMs object with rank transformed dissimilarities

Return type

rdms_new(RDMs)

rsatoolbox.rdm.transform.sqrt_transform(rdms)[source]

applies a square root transform and generates a new RDMs object This sets values blow 0 to 0 and takes a square root of each entry. It also adds a sqrt to the dissimilarity_measure entry.

Parameters

rdms (RDMs) – RDMs object

Returns

RDMs object with sqrt transformed dissimilarities

Return type

rdms_new(RDMs)

rsatoolbox.rdm.transform.transform(rdms, fun)[source]

applies an arbitray function fun to the dissimilarities and returns a new RDMs object.

Parameters

rdms (RDMs) – RDMs object

Returns

RDMs object with sqrt transformed dissimilarities

Return type

rdms_new(RDMs)