Crate rand_split

Source
Expand description

This crate achieves the functionality of sklearn’s train_test_split to generate splits of the data (in this case, a slice), generalized for an arbitrary number of splits. It both provides functions (see split_parts) that work on slices and iterator traits (see PartsSplit)to work with streams of data.

Check out the examples in the repository for more information.

Traits§

PartsSplit
An iterator trait to generate splits from a data stream of unknown lenght.
TTVSplit
An iterator type to generate train/test/validaton splits from a data stream of unknown lenght.

Functions§

split_parts
Split the elements of a container in randomized sets which contain a a part (in splits) of the input.
train_test_split
Generate train-test splits. Wrapper around split_parts
ttv_split
Generate train-test-validation splits. Wrapper around split_parts