SG++-Doxygen-Documentation
sgpp::datadriven::DataShufflingFunctorCrossValidation Class Reference

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>

Inheritance diagram for sgpp::datadriven::DataShufflingFunctorCrossValidation:
sgpp::datadriven::DataShufflingFunctor

Public Member Functions

DataShufflingFunctorclone () 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
 
DataShufflingFunctoroperator= (const DataShufflingFunctor &rhs)=default
 
DataShufflingFunctoroperator= (DataShufflingFunctor &&rhs)=default
 
virtual ~DataShufflingFunctor ()=default
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DataShufflingFunctorCrossValidation()

sgpp::datadriven::DataShufflingFunctorCrossValidation::DataShufflingFunctorCrossValidation ( const CrossvalidationConfiguration  crossValidationConfig,
DataShufflingFunctor shuffling 
)

Constructor.

Parameters
crossValidationConfigconfiguration for the cross validation
shufflingthe shuffling functor this functor is chained after

Member Function Documentation

◆ clone()

DataShufflingFunctor * sgpp::datadriven::DataShufflingFunctorCrossValidation::clone ( ) const
overridevirtual

Clone pattern.

Returns
identical copy of this instance

Implements sgpp::datadriven::DataShufflingFunctor.

◆ getCurrentFoldSize()

size_t sgpp::datadriven::DataShufflingFunctorCrossValidation::getCurrentFoldSize ( size_t  numSamples)

Returns the size of the fold currently used for validation.

Parameters
numSamplesthe number of samples in total
Returns
size of current fold

References sgpp::datadriven::CrossvalidationConfiguration::kfold_.

Referenced by operator()(), and sgpp::datadriven::DataSourceCrossValidation::reset().

◆ operator()()

size_t sgpp::datadriven::DataShufflingFunctorCrossValidation::operator() ( size_t  idx,
size_t  numSamples 
)
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.

Parameters
idxthe original index
numSamplesthe total number of indexes to permute
Returns
idx the index after the permutation (simply the input)

Implements sgpp::datadriven::DataShufflingFunctor.

References getCurrentFoldSize(), and sgpp::datadriven::CrossvalidationConfiguration::kfold_.

◆ setFold()

void sgpp::datadriven::DataShufflingFunctorCrossValidation::setFold ( size_t  fold)

Set the index of the current fold.

Parameters
foldthe index of the current fold

References sgpp::datadriven::CrossvalidationConfiguration::kfold_.

Referenced by sgpp::datadriven::DataSourceCrossValidation::setFold().


The documentation for this class was generated from the following files: