yat  0.16pre
Public Member Functions | Protected Attributes | List of all members
theplu::yat::classifier::CrossValidationSampler Class Reference

Class splitting a set into training set and validation set in a crossvalidation manner. More...

#include <yat/classifier/CrossValidationSampler.h>

Inheritance diagram for theplu::yat::classifier::CrossValidationSampler:
theplu::yat::classifier::Sampler

Public Member Functions

 CrossValidationSampler (const Target &target, const size_t N, const size_t k)
 Constructor. More...
 
virtual ~CrossValidationSampler ()
 
size_t size (void) const
 
const Targettarget (void) const
 
const utility::Indextraining_index (size_t i) const
 
const Targettraining_target (size_t i) const
 
const utility::Indexvalidation_index (size_t i) const
 
const Targetvalidation_target (size_t i) const
 

Protected Attributes

std::vector< utility::Indextraining_index_
 index of training sets for the partitions
 
std::vector< Targettraining_target_
 Targets for training sets for the partitions.
 
std::vector< utility::Indexvalidation_index_
 index of validation sets for the partitions
 
std::vector< Targetvalidation_target_
 Targets for validation sets for the partitions.
 

Detailed Description

Class splitting a set into training set and validation set in a crossvalidation manner.

This is done in a balanced way, meaning the proportions between the classes in the trainingset is close to the proportions in the whole dataset. In the first k rounds each sample is returned k-1 times, for next round the samples are shuffled and... In total there are N partitions, in other words, each sample is in validation roughly N/k

Constructor & Destructor Documentation

theplu::yat::classifier::CrossValidationSampler::CrossValidationSampler ( const Target target,
const size_t  N,
const size_t  k 
)

Constructor.

target targets. N total number of partitions. k for k-fold crossvalidation.

virtual theplu::yat::classifier::CrossValidationSampler::~CrossValidationSampler ( )
virtual

Destructor

Member Function Documentation

size_t theplu::yat::classifier::Sampler::size ( void  ) const
inherited
Returns
number of partitions
const Target& theplu::yat::classifier::Sampler::target ( void  ) const
inherited
Returns
the targets for the total set
const utility::Index& theplu::yat::classifier::Sampler::training_index ( size_t  i) const
inherited
Returns
training indices
const Target& theplu::yat::classifier::Sampler::training_target ( size_t  i) const
inherited
Returns
training target
Note
if state is invalid the result is undefined
const utility::Index& theplu::yat::classifier::Sampler::validation_index ( size_t  i) const
inherited
Returns
validation index
Note
if state is invalid the result is undefined
const Target& theplu::yat::classifier::Sampler::validation_target ( size_t  i) const
inherited
Returns
validation target
Note
if state is invalid the result is undefined

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

Generated on Wed May 23 2018 02:32:35 for yat by  doxygen 1.8.11