SG++-Doxygen-Documentation
|
CSVFileSampleProvider allows reading data in CSV format into a sgpp::datadriven::Dataset object. More...
#include <CSVFileSampleProvider.hpp>
Public Member Functions | |
SampleProvider * | clone () const override |
Clone Pattern to allow copying of derived classes. More... | |
CSVFileSampleProvider (DataShufflingFunctor *shuffling=nullptr) | |
Default constructor. More... | |
Dataset * | getAllSamples () override |
Asks to return all available samples. More... | |
size_t | getDim () const override |
Returns the maximal dimensionality of the data. More... | |
Dataset * | getNextSamples (size_t howMany) override |
Lets the user request a certain amount of samples. More... | |
size_t | getNumSamples () const override |
Returns the number of samples availible or throws if not possible. More... | |
void | readFile (const std::string &filePath, bool hasTargets, size_t readinCutoff=-1, std::vector< size_t > readinColumns=std::vector< size_t >(), std::vector< double > readinClasses=std::vector< double >()) override |
Open an existing CSV file, parse it and store its contents inside this class. More... | |
void | readString (const std::string &input, bool hasTargets, size_t readinCutoff=-1, std::vector< size_t > readinColumns=std::vector< size_t >(), std::vector< double > readinClasses=std::vector< double >()) override |
Currently not implemented. More... | |
void | reset () override |
Resets the state of the sample provider (e.g. More... | |
Public Member Functions inherited from sgpp::datadriven::SampleProvider | |
SampleProvider & | operator= (const SampleProvider &rhs)=default |
SampleProvider & | operator= (SampleProvider &&rhs)=default |
SampleProvider ()=default | |
SampleProvider (const SampleProvider &rhs)=default | |
SampleProvider (SampleProvider &&rhs)=default | |
virtual | ~SampleProvider ()=default |
CSVFileSampleProvider allows reading data in CSV format into a sgpp::datadriven::Dataset object.
Data can currently only be a file containing CSV data with the first line containing column titles (is skipped).
|
explicit |
Default constructor.
shuffling | functor to permute the training data indexes |
|
overridevirtual |
Clone Pattern to allow copying of derived classes.
Implements sgpp::datadriven::SampleProvider.
|
overridevirtual |
Asks to return all available samples.
This functionality is designed for returning all available samples from an entire file.
Implements sgpp::datadriven::SampleProvider.
References sgpp::datadriven::Dataset::getDimension(), getNextSamples(), and sgpp::datadriven::Dataset::getNumberInstances().
|
overridevirtual |
Returns the maximal dimensionality of the data.
Implements sgpp::datadriven::SampleProvider.
References sgpp::datadriven::Dataset::getDimension().
Referenced by python.uq.dists.SGDEdist.SGDEdist::__str__(), and python.uq.dists.KDEDist.KDEDist::getBandwidths().
|
overridevirtual |
Lets the user request a certain amount of samples.
This functionality is is designed for streaming algorithms where data is processed in batches.
howMany | number requested amount of samples. The amount of actually provided samples can be smaller, if there is not sufficient data. |
Implements sgpp::datadriven::SampleProvider.
References sgpp::datadriven::Dataset::getDimension().
Referenced by getAllSamples().
|
overridevirtual |
Returns the number of samples availible or throws if not possible.
Implements sgpp::datadriven::SampleProvider.
References sgpp::datadriven::Dataset::getDimension(), and sgpp::datadriven::Dataset::getNumberInstances().
|
overridevirtual |
Open an existing CSV file, parse it and store its contents inside this class.
Throws if file can not be opened or parsed.
filePath | Path to an existing file. |
hasTargets | whether the file has targest (i.e. supervised learning) |
readinCutoff | see FileSampleProvider.hpp |
readinColumns | see FileSampleProvider.hpp |
readinClasses | see FileSampleProvider.hpp |
Implements sgpp::datadriven::FileSampleProvider.
References sgpp::datadriven::CSVTools::readCSVFromFile().
|
overridevirtual |
Currently not implemented.
input | string containing information in CSV file format |
hasTargets | whether the file has targest (i.e. supervised learning) |
readinCutoff | see FileSampleProvider.hpp |
readinColumns | see FileSampleProvider.hpp |
readinClasses | see FileSampleProvider.hpp |
Implements sgpp::datadriven::FileSampleProvider.
References sgpp::datadriven::Dataset::getData(), sgpp::datadriven::Dataset::getDimension(), sgpp::datadriven::Dataset::getNumberInstances(), sgpp::datadriven::Dataset::getTargets(), python.statsfileInfo::i, and sgpp::base::DataMatrix::setRow().
|
overridevirtual |
Resets the state of the sample provider (e.g.
to start a new epoch)
Implements sgpp::datadriven::SampleProvider.