leaderbot.data.split#
- leaderbot.data.split(data, test_ratio=0.2, seed=0)#
Split data to training and test data.
- Parameters:
- dataDataType
Input dataset.
- test_ratiofloat, default=0.2
The ratio of the number of samples from test data with respect to the input dataset. The ration should be a number between zero and one.
- seedint, default=0
Random state to initialize random generation. If None, no seed will be set.
- Returns:
- training_dataDataType
Training data with the ratio of
1-test_ratio
number of samples.- test_dataDataType
Test data with the ratio of
test_ratio
number of samples.
See also
Examples
>>> import leaderbot as lb >>> # Load default dataset >>> data = lb.data.load() >>> # Split data to training and test data >>> training_data, test_data = lb.data.split(data)