To provide the most recent news and documentation www.pymvpa.org reflects the development 2.0 series (renamed 0.6 series) of PyMVPA. If you are interested in the documentation of the previous stable 0.4 series of PyMVPA, please visit v04.pymvpa.org.

mvpa2.datasets.miscfx.random_samples

mvpa2.datasets.miscfx.random_samples(dataset, npertarget, targets_attr='targets')

Create a dataset with a random subset of samples.

Parameters :

dataset : Dataset

npertarget : int or list

If an int is given, the specified number of samples is randomly chosen from the group of samples sharing a unique target value. Total number of selected samples: npertarget x len(uniquetargets). If a list is given of length matching the unique target values, it specifies the number of samples chosen for each particular unique target.

targets_attr : str, optional

Returns :

Dataset :

A dataset instance for the chosen samples. All feature attributes and dataset attribute share there data with the source dataset.

NeuroDebian

NITRC-listed