SG++-Doxygen-Documentation
|
A pseudo shuffling functor, that maps indices 0...foldSize-1 to the current fold while mapping the other indices sequentially to the rest of the dataset. More...
#include <DataShufflingFunctorCrossValidation.hpp>
Public Member Functions | |
DataShufflingFunctor * | clone () const override |
Clone pattern. More... | |
DataShufflingFunctorCrossValidation (const CrossvalidationConfiguration crossValidationConfig, DataShufflingFunctor *shuffling) | |
Constructor. More... | |
size_t | getCurrentFoldSize (size_t numSamples) |
Returns the size of the fold currently used for validation. More... | |
size_t | operator() (size_t idx, size_t numSamples) override |
Overload the function-call operator that maps indexes to indexes via a permutation of the entire index set. More... | |
void | setFold (size_t fold) |
Set the index of the current fold. More... | |
Public Member Functions inherited from sgpp::datadriven::DataShufflingFunctor | |
DataShufflingFunctor () | |
DataShufflingFunctor (const DataShufflingFunctor &rhs)=default | |
DataShufflingFunctor (DataShufflingFunctor &&rhs)=default | |
DataShufflingFunctor & | operator= (const DataShufflingFunctor &rhs)=default |
DataShufflingFunctor & | operator= (DataShufflingFunctor &&rhs)=default |
virtual | ~DataShufflingFunctor ()=default |
A pseudo shuffling functor, that maps indices 0...foldSize-1 to the current fold while mapping the other indices sequentially to the rest of the dataset.
Another shuffling functor is chained to the results of this functor in order to retrieve a real shuffling.
sgpp::datadriven::DataShufflingFunctorCrossValidation::DataShufflingFunctorCrossValidation | ( | const CrossvalidationConfiguration | crossValidationConfig, |
DataShufflingFunctor * | shuffling | ||
) |
Constructor.
crossValidationConfig | configuration for the cross validation |
shuffling | the shuffling functor this functor is chained after |
|
overridevirtual |
Clone pattern.
Implements sgpp::datadriven::DataShufflingFunctor.
size_t sgpp::datadriven::DataShufflingFunctorCrossValidation::getCurrentFoldSize | ( | size_t | numSamples | ) |
Returns the size of the fold currently used for validation.
numSamples | the number of samples in total |
References sgpp::datadriven::CrossvalidationConfiguration::kfold_.
Referenced by operator()(), and sgpp::datadriven::DataSourceCrossValidation::reset().
|
overridevirtual |
Overload the function-call operator that maps indexes to indexes via a permutation of the entire index set.
The permutation used is the identity.
idx | the original index |
numSamples | the total number of indexes to permute |
Implements sgpp::datadriven::DataShufflingFunctor.
References getCurrentFoldSize(), and sgpp::datadriven::CrossvalidationConfiguration::kfold_.
void sgpp::datadriven::DataShufflingFunctorCrossValidation::setFold | ( | size_t | fold | ) |
Set the index of the current fold.
fold | the index of the current fold |
References sgpp::datadriven::CrossvalidationConfiguration::kfold_.
Referenced by sgpp::datadriven::DataSourceCrossValidation::setFold().