SG++-Doxygen-Documentation
|
DataSource is a high level, easy to use interface for accessing data provided by a all kinds of sgpp::datadriven::SampleProvider. More...
#include <DataSource.hpp>
Public Member Functions | |
DataSourceIterator | begin () |
Return an iterator object pointing to the first batch of this DataSource. More... | |
DataSource (DataSourceConfig config, SampleProvider *sampleProvider) | |
Constructor. More... | |
DataSourceIterator | end () |
Return an iterator object pointing to the last possible batch of this DataSource. More... | |
const DataSourceConfig & | getConfig () const |
Read only access to the configuration used by DataSource and underlying SampleProvider. More... | |
size_t | getCurrentIteration () const |
Return how many batches have already been requested from this DataSource. More... | |
virtual Dataset * | getNextSamples () |
Request data from the underlying SampleProvider as specified in the provided configuration object upon construction. More... | |
virtual Dataset * | getValidationData ()=0 |
Returns the data that is used for validation. More... | |
virtual | ~DataSource ()=default |
Protected Attributes | |
DataSourceConfig | config |
Configuration file that determines all relevant properties of the object. More... | |
size_t | currentIteration |
counter variable if data is requested in batches. More... | |
DataTransformation * | dataTransformation |
pointer to DataTransformation to perform transformations on init. More... | |
std::unique_ptr< SampleProvider > | sampleProvider |
pointer to sample provider that actually handles data aquisition. More... | |
DataSource is a high level, easy to use interface for accessing data provided by a all kinds of sgpp::datadriven::SampleProvider.
Should be used by end users.
sgpp::datadriven::DataSource::DataSource | ( | DataSourceConfig | config, |
SampleProvider * | sampleProvider | ||
) |
Constructor.
config | configuration object used for the data source |
sampleProvider | the sample provider to operate on. |
References sgpp::datadriven::DataTransformationBuilder::buildTransformation(), config, dataTransformation, sgpp::datadriven::DataSourceConfig::dataTransformationConfig, sgpp::datadriven::DataSourceConfig::filePath, and sampleProvider.
|
virtualdefault |
DataSourceIterator sgpp::datadriven::DataSource::begin | ( | ) |
Return an iterator object pointing to the first batch of this DataSource.
Can be used to obtain new batches in batch learning scenarios as often as specified inside the configuration. Allows convenient range based for loops for batch learning.
DataSourceIterator sgpp::datadriven::DataSource::end | ( | ) |
Return an iterator object pointing to the last possible batch of this DataSource.
Required for range based for loops.
References config, and sgpp::datadriven::DataSourceConfig::numBatches.
const DataSourceConfig & sgpp::datadriven::DataSource::getConfig | ( | ) | const |
Read only access to the configuration used by DataSource and underlying SampleProvider.
References config.
size_t sgpp::datadriven::DataSource::getCurrentIteration | ( | ) | const |
Return how many batches have already been requested from this DataSource.
Required for range based for loops using the DataSourceIterator.
References currentIteration.
|
virtual |
Request data from the underlying SampleProvider as specified in the provided configuration object upon construction.
References sgpp::datadriven::DataSourceConfig::batchSize, config, currentIteration, dataset, dataTransformation, sgpp::datadriven::DataSourceConfig::dataTransformationConfig, sgpp::datadriven::DataTransformation::doTransformation(), sgpp::datadriven::DataTransformation::initialize(), sgpp::datadriven::NONE, sgpp::datadriven::DataSourceConfig::numBatches, sampleProvider, and sgpp::datadriven::DataTransformationConfig::type.
Referenced by sgpp::datadriven::DataSourceIterator::operator*().
|
pure virtual |
Returns the data that is used for validation.
Implemented in sgpp::datadriven::DataSourceCrossValidation, and sgpp::datadriven::DataSourceSplitting.
|
protected |
Configuration file that determines all relevant properties of the object.
Referenced by DataSource(), sgpp::datadriven::DataSourceSplitting::DataSourceSplitting(), end(), getConfig(), getNextSamples(), and sgpp::datadriven::DataSourceSplitting::reset().
|
protected |
counter variable if data is requested in batches.
Referenced by getCurrentIteration(), and getNextSamples().
|
protected |
pointer to DataTransformation to perform transformations on init.
Referenced by DataSource(), and getNextSamples().
|
protected |
pointer to sample provider that actually handles data aquisition.
Referenced by DataSource(), and getNextSamples().