Split ImageDatastore labels by proportions
[
splits the image files in imds1,imds2
] = splitEachLabel(imds
,p
)imds
into two new datastores,
imds1
and imds2
. The new datastore
imds1
contains the first p
files from
each label and imds2
contains the remaining files from each
label. p
can be either a number between 0 and 1 indicating
the percentage of the files from each label to assign to
imds1
, or an integer indicating the absolute number of
files from each label to assign to imds1
.
[
splits the datastore into imds1,...,imdsM
] = splitEachLabel(imds
,p1,...,pN
)N+1
new datastores. The first new
datastore imds1
contains the first p1
files from each label, the next new datastore imds2
contains
the next p2
files, and so on. If p1,...,pN
represent numbers of files, then their sum must be no more than the number of
files in the smallest label in the original datastore
imds
.
___ = splitEachLabel(___,'randomized')
randomly assigns the specified proportion of files from each label to the new
datastores.
___ = splitEachLabel(___,
specifies the properties of the new datastores using one or more name-value pair
arguments. For example, you can specify which labels to split with
Name,Value
)'Include','labelname'
.