Changing the ration in Train, Test Split

#6
by alimohsan - opened

Hi,
Please forgive me if this is a dumb question as I am a beginner in this field. I want to change the 50%-50% split of train and test dataset as I need, let sat 80%-20%. How can I do that, because when I use
--- train_dataset, valid_dataset = load_dataset('imdb', split=['train', 'test']) ---
it automatically split the dataset in 50-50. Can I use something like split_ratio?

I'm not sure if you've found the answer yet.

Total samples = train size + test size = 50000, which means an 8-2 split would result in 40000 - 10000 samples in each set, respectively.

Therefore, you can split the valid_dataset into extra_train and valid_new with 10000 - 15000 samples each, then merge extra_train into the train. This equals a train_test_split with test_size = 0.6

Sign up or log in to comment