How to divide images in a folder into two groups (training set and test set)?

2 views (last 30 days)
I do not know the function to divide the images or maybe you can help me by sharing other ways?
[trainingSet, testSet] = function (imds, 0.3, 'randomize');

Answers (1)

Srivardhan Gadila
Srivardhan Gadila on 29 Apr 2020
To divide the trainingSet and testSet in the ratio 7:3, use the function splitEachLabel as follows:
[trainingSet,testSet] = splitEachLabel(imds,0.7,'randomized');
Refer to the documentation of splitEachLabel for more information.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!