Generate DSMs from an array of data, possibly in a searchlight pattern.
First use searchlight
to compute the searchlight patches.
Then you can use this function to compute DSMs for each searchlight patch.
An array containing the data.
Searchlight patches as generated by searchlight
. If None
,
no searchlight is used. Defaults to None
.
The distance metric to use to compute the DSMs. Can be any metric
supported by scipy.spatial.distance.pdist()
. When a function is
specified, it needs to take in two vectors and output a single number.
See also the dist_params
parameter to specify and additional
parameter for the distance function.
Defaults to ‘correlation’.
Extra arguments for the distance metric used to compute the DSMs.
Refer to scipy.spatial.distance
for a list of all other metrics
and their arguments. Defaults to an empty dictionary.
For each item, a number indicating the class to which the item belongs.
When None
, each item is assumed to belong to a different class.
Defaults to None
.
Number of cross-validation folds to use when computing the distance
metric. Folds are created based on the y
parameter. Specify
None
to use the maximum number of folds possible, given the data.
Alternatively, you can pass a Scikit-Learn cross validator object (e.g.
sklearn.model_selection.KFold
) to assert fine-grained control over
how folds are created.
Defaults to 1 (no cross-validation).
A DSM (in condensed form) for each searchlight patch.
See also
dsm
rsa
searchlight
Multidimensional shape of the generted DSMs.
This is useful for re-shaping the result obtained after consuming the this generator.
Three elements: the number of time-series, number of time samples and length of a consensed DSM.
Two element: the number of time-series and length of a condensed DSM.
Two elements: the number of time-samples and length of a condensed DSM.
One element: the length of a condensed DSM.
Return hash(self).