I have a data frame in which two columns are there text_data and distractor. How to divide in train,test and validation in pytorch.
If you’ve already created a Dataset
instance for your data frame, you could use torch.utils.data.random_split to create non-overlapping Datasets
.
Alternatively, you could also split the data before creating the Dataset
s e.g. via sklearn.model_selection.train_test_split or just by manually indexing the data frame.