Skip to content

splits

diapason.evals.core.splits

Deterministic train/test split helper used by dataset providers.

apply_split(items, *, split, seed, train_frac)

Return a deterministic slice of items according to split.

The underlying permutation is random.Random(seed).shuffle(items_copy). train is the first int(len(items) * train_frac) entries of the shuffle, test is the remainder, all is the whole shuffle.