scvi.dataloaders.DataSplitter.from_datasets

classmethod DataSplitter.from_datasets(train_dataset=None, val_dataset=None, test_dataset=None, batch_size=1, num_workers=0)

Create an instance from torch.utils.data.Dataset.

Parameters
train_dataset : Dataset | Sequence[Dataset] | Mapping | NoneUnion[Dataset, Sequence[Dataset], Mapping[str, Dataset], None] (default: None)

(optional) Dataset to be used for train_dataloader()

val_dataset : Dataset | Sequence[Dataset] | NoneUnion[Dataset, Sequence[Dataset], None] (default: None)

(optional) Dataset or list of Dataset to be used for val_dataloader()

test_dataset : Dataset | Sequence[Dataset] | NoneUnion[Dataset, Sequence[Dataset], None] (default: None)

(optional) Dataset or list of Dataset to be used for test_dataloader()

batch_size : intint (default: 1)

Batch size to use for each dataloader. Default is 1.

num_workers : intint (default: 0)

Number of subprocesses to use for data loading. 0 means that the data will be loaded in the main process. Number of CPUs available.