How do you divide your dataset given each class is in one folder

My folder structure looks like this
root

└───class1
│ │ image1.jpg
│ │ image2.jpg
└───class2
│ │ image1.jpg
│ │ image2.jpg
└───class3
│ │ image1.jpg
│ │ image2.jpg

Now I wish to divide my dataset into train and validations sets inorder to work on it with FastAI how do you suggest I do that? thanks!

Hi @Khalifa1997 ,
Can you please share how you intend to divide your data set?

But,nevertheless, you can still use

split_by_rand_pct()

if you wish to split it by random. If you wish to split it in some other way, you may have to write some code to organize your data first.
All the best

Just adding this link to the datablock documentation. If you scroll down to from_folder you should find the setup you are looking for.

https://docs.fast.ai/data_block.html#ItemList.filter_by_folder