nifreeze.data.splitting module

Data splitting helpers.

nifreeze.data.splitting.lovo_split(dataset: BaseDataset, index: int) tuple[Any, Any][source]

Produce one fold of LOVO (leave-one-volume-out).

Parameters:
Returns:

A tuple of two elements, the first element being the components of the train data (including the data themselves and other metadata such as gradients for dMRI, or frame times for PET), and the second element being the test data.

Return type:

tuple of tuple