chainer.datasets.split_dataset

chainer.datasets.split_dataset(dataset, split_at, order=None)[source]

Splits a dataset into two subsets.

This function creates two instances of SubDataset. These instances do not share any examples, and they together cover all examples of the original dataset.

Parameters:
  • dataset – Dataset to split.
  • split_at (int) – Position at which the base dataset is split.
  • order (sequence of ints) – Permutation of indexes in the base dataset. See the document of SubDataset for details.
Returns:

Two SubDataset objects. The first subset represents the

examples of indexes order[:split_at] while the second subset represents the examples of indexes order[split_at:].

Return type:

tuple