Dataset shuffle: Difference between revisions
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...") |
imported>Benjamin mNo edit summary |
||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Returns the given Dataset object shuffled in a specified dimension. | Returns the given Dataset object shuffled in a specified dimension. | ||
Line 10: | Line 8: | ||
===Description=== | ===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. | 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. | ||
This method was introduced to the DataSet object after the release of PLS_Toolbox/Solo version 8.3. | |||
===Examples=== | ===Examples=== |
Latest revision as of 14:21, 3 February 2017
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.
This method was introduced to the DataSet object after the release of PLS_Toolbox/Solo version 8.3.
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);