Dataset shuffle

From Eigenvector Research Documentation Wiki
Revision as of 14:15, 3 February 2017 by imported>Benjamin (Created page with "Dataset_shuffle ===Purpose=== Returns the given Dataset object shuffled in a specified dimension. ===Synopsis=== :dsoOut = shuffle(dsoIn,vDim,inVect); :[dsoOut,randVect,undo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Dataset_shuffle

Purpose

Returns the given Dataset object shuffled in a specified dimension.

Synopsis

dsoOut = shuffle(dsoIn,vDim,inVect);
[dsoOut,randVect,undoVect] = shuffle(dsoIn,vDim,inVect);

Description

Shuffle the Dataset object with the shuffle command. This method returns the DataSet Object with the desired entry in the specified dimension (rows, columns, etc.) randomize. The order of the shuffle is stored in the second input argument (randVect) can be used to shuffle another DataSet object in the exact same other. The third input argument (undoVect) can be used to undo the shuffle of the DataSet object.

Examples

To repeat a shuffle to a new DataSet object, use the previous randVect as the third input argument when shuffling a new DataSet:

data = shuffle(newData,1,randVect);

To undo a shuffle to a dataset, input the dataset along with the undoVect with the corresponding dimension:

unshuffledData = shuffle(data,1,undoVect);

Alternatively, shuffle can also be used to sort a dataset to a specific order using a vector containing the ordered indexes:

reorderedData = shuffle(data,1,newOrderVect);