Main Content

shuffle

Shuffle all data in datastore

Description

dsrand = shuffle(ds) returns a datastore object containing a random ordering of the data from ds.

example

Examples

collapse all

Create an ImageDatastore object imds. Shuffle the files to create a new datastore containing the same files in random order.

imds = imageDatastore(["cloudCombined.png","example.tif","landOcean.jpg","street2.jpg","corn.tif"]);
imdsrand = shuffle(imds)
imdsrand = 

  ImageDatastore with properties:

                       Files: {
                              'C:\folder1\landOcean.jpg';
                              'C:\folder1\cloudCombined.png';
                              'C:\folder1\corn.tif'
                               ... and 2 more
                              }
                     Folders: {
                              'C:\folder1'
                              }
    AlternateFileSystemRoots: {}
                    ReadSize: 1
                      Labels: {}
      SupportedOutputFormats: ["png"    "jpg"    "jpeg"    "tif"    "tiff"]
         DefaultOutputFormat: "png"
                     ReadFcn: @readDatastoreImage

Input Arguments

collapse all

Input datastore, specified as a datastore object. The input datastore can be any datastore for which isShuffleable returns true (such as imageDatastore). The input datastore also can be a CombinedDatastore, SequentialDatastore, or TransformedDatastore for which all underlying datastores are shuffleable.

Output Arguments

collapse all

Output datastore, returned as a datastore object containing randomly ordered data from ds.

Extended Capabilities

expand all

Version History

Introduced in R2016a