SG++-Doxygen-Documentation
|
Generate an instance of sgpp::datadriven::DataSource using the Builder Pattern. More...
#include <DataSourceBuilder.hpp>
Public Member Functions | |
DataSourceCrossValidation * | crossValidationAssemble () const |
Based on the currently specified configuration, build and configure an instance of a data source object that is able to perform cross validation. More... | |
DataSourceCrossValidation * | crossValidationFromConfig (const DataSourceConfig &config, const CrossvalidationConfiguration &crossValidationConfig) |
Factory method used to build an instance of a sgpp::datadriven::DataSourceCrossValidation object based on the passed configuration. More... | |
DataSourceBuilder ()=default | |
Default constructor. More... | |
DataSourceBuilder & | inBatches (size_t howMany) |
Optionally Specify the amount of batches if batch learning is used. More... | |
DataSourceSplitting * | splittingAssemble () const |
Based on the currently specified configuration, build and configure an instance of a data source object. More... | |
DataSourceSplitting * | splittingFromConfig (const DataSourceConfig &config) |
Factory method used to build an instance of a sgpp::datadriven::DataSourceSplitting object based on the passed configuration. More... | |
DataSourceBuilder & | withBatchSize (size_t batchSize) |
Optionally Specify the batch size if batch learning is used. More... | |
DataSourceBuilder & | withCompression (bool isCompressed) |
Optionally Specify if the file used is gz compressed. More... | |
DataSourceBuilder & | withFileType (DataSourceFileType fileType) |
Optionally Specify the file type if files are used. More... | |
DataSourceBuilder & | withPath (const std::string &filePath) |
Optionally specify a valid path to a file that should be read if files are used. More... | |
Generate an instance of sgpp::datadriven::DataSource using the Builder Pattern.
|
default |
Default constructor.
DataSourceCrossValidation * sgpp::datadriven::DataSourceBuilder::crossValidationAssemble | ( | ) | const |
Based on the currently specified configuration, build and configure an instance of a data source object that is able to perform cross validation.
References sgpp::datadriven::ARFF, sgpp::datadriven::DataShufflingFunctorFactory::buildDataShufflingFunctor(), sgpp::datadriven::CSV, sgpp::datadriven::DataSourceConfig::fileType, and sgpp::datadriven::DataSourceConfig::isCompressed.
Referenced by crossValidationFromConfig(), and main().
DataSourceCrossValidation * sgpp::datadriven::DataSourceBuilder::crossValidationFromConfig | ( | const DataSourceConfig & | config, |
const CrossvalidationConfiguration & | crossValidationConfig | ||
) |
Factory method used to build an instance of a sgpp::datadriven::DataSourceCrossValidation object based on the passed configuration.
config | configuration for the data source instance |
crossValidationConfig | configuration for the cross validation |
References crossValidationAssemble(), sgpp::datadriven::DataSourceConfig::filePath, sgpp::datadriven::DataSourceConfig::fileType, sgpp::datadriven::NONE, sgpp::datadriven::DataSourceFileTypeParser::parse(), sgpp::datadriven::StringTokenizer::tokenize(), create_dataset::type, withCompression(), and withFileType().
Referenced by sgpp::datadriven::MinerFactory::createDataSourceCrossValidation().
DataSourceBuilder & sgpp::datadriven::DataSourceBuilder::inBatches | ( | size_t | howMany | ) |
Optionally Specify the amount of batches if batch learning is used.
If no batch learning is used, all data is returned as a single batch (same as howMany=1).
howMany | amount of batches used in batch learning scenario. |
References sgpp::datadriven::DataSourceConfig::numBatches.
DataSourceSplitting * sgpp::datadriven::DataSourceBuilder::splittingAssemble | ( | ) | const |
Based on the currently specified configuration, build and configure an instance of a data source object.
References sgpp::datadriven::ARFF, sgpp::datadriven::DataShufflingFunctorFactory::buildDataShufflingFunctor(), sgpp::datadriven::CSV, sgpp::datadriven::DataSourceConfig::fileType, and sgpp::datadriven::DataSourceConfig::isCompressed.
Referenced by splittingFromConfig().
DataSourceSplitting * sgpp::datadriven::DataSourceBuilder::splittingFromConfig | ( | const DataSourceConfig & | config | ) |
Factory method used to build an instance of a sgpp::datadriven::DataSourceSplitting object based on the passed configuration.
config | configuration for the data source instance |
References sgpp::datadriven::DataSourceConfig::fileType, sgpp::datadriven::NONE, and splittingAssemble().
Referenced by sgpp::datadriven::MinerFactory::createDataSourceSplitting().
DataSourceBuilder & sgpp::datadriven::DataSourceBuilder::withBatchSize | ( | size_t | batchSize | ) |
Optionally Specify the batch size if batch learning is used.
If no batch learning is used this value defaults to 0 (all samples).
batchSize | size of batches used in batch learning scenario. |
References sgpp::datadriven::DataSourceConfig::batchSize.
DataSourceBuilder & sgpp::datadriven::DataSourceBuilder::withCompression | ( | bool | isCompressed | ) |
Optionally Specify if the file used is gz compressed.
If data source does not use any files, this is set to false by default.
isCompressed | true if the file is compressed, false otherwise. |
References sgpp::datadriven::DataSourceConfig::isCompressed.
Referenced by crossValidationFromConfig().
DataSourceBuilder & sgpp::datadriven::DataSourceBuilder::withFileType | ( | DataSourceFileType | fileType | ) |
Optionally Specify the file type if files are used.
If data source does not use any files, this is set to none by default.
fileType | value of |
References sgpp::datadriven::DataSourceConfig::fileType.
Referenced by crossValidationFromConfig().
DataSourceBuilder & sgpp::datadriven::DataSourceBuilder::withPath | ( | const std::string & | filePath | ) |
Optionally specify a valid path to a file that should be read if files are used.
filePath | valid path to a file that should be read by the data source. |
References sgpp::datadriven::DataSourceConfig::filePath, sgpp::datadriven::DataSourceConfig::fileType, and sgpp::datadriven::NONE.
Referenced by main().