![]() |
SG++
|
A shuffling functor generates a permutation for a set of indices. More...
#include <ShufflingFunctor.hpp>
Public Member Functions | |
virtual ShufflingFunctor * | clone () const =0 |
Polymorphic clone pattern. More... | |
int64_t | getSeed () const |
Get random seed for randomized operations. More... | |
ShufflingFunctor & | operator= (const ShufflingFunctor &rhs)=default |
ShufflingFunctor & | operator= (ShufflingFunctor &&rhs)=default |
void | setSeed (int64_t seed) |
Set random seed for randomized operations. More... | |
virtual void | shuffle (const Dataset &data, std::vector< size_t > &indices)=0 |
Create a permutation of a Dataset from a vector of indices. More... | |
ShufflingFunctor () | |
ShufflingFunctor (const ShufflingFunctor &rhs)=default | |
ShufflingFunctor (ShufflingFunctor &&rhs)=default | |
virtual | ~ShufflingFunctor ()=default |
Protected Attributes | |
std::mt19937 | generator |
Pseudo random number generator required for shuffling. More... | |
int64_t | seed |
Random seed for a pseudo random number generator. More... | |
A shuffling functor generates a permutation for a set of indices.
Can be used to generate a random or particular ordering of samples from a potentially ordered dataset as training and testing data should be evenly distributed when performing training with testing or cross-validation.
|
default |
|
default |
|
virtualdefault |
|
pure virtual |
Polymorphic clone pattern.
Implemented in sgpp::datadriven::RandomShufflingFunctor, and sgpp::datadriven::SequentialShufflingFunctor.
int64_t sgpp::datadriven::ShufflingFunctor::getSeed | ( | ) | const |
|
default |
|
default |
void sgpp::datadriven::ShufflingFunctor::setSeed | ( | int64_t | seed | ) |
|
pure virtual |
Create a permutation of a Dataset from a vector of indices.
The indices can then be mapped back to the samples.
data | Dataset to be permuted. |
indices | vector containing indices. Will permute indices in place. |
Implemented in sgpp::datadriven::RandomShufflingFunctor, and sgpp::datadriven::SequentialShufflingFunctor.
|
protected |
Pseudo random number generator required for shuffling.
Referenced by setSeed(), sgpp::datadriven::RandomShufflingFunctor::shuffle(), and ShufflingFunctor().
|
protected |
Random seed for a pseudo random number generator.
Same seeds should produce identical random numbers. Required as an initialization for the random number generator.
Referenced by getSeed(), setSeed(), and ShufflingFunctor().