SG++
sgpp::datadriven::FileSampleProvider Class Referenceabstract

sgpp::datadriven::FileSampleProvider is an specialization of sgpp::datadriven::SampleProvider and provides an interface for all sample providers that get their samples from files. More...

#include <FileSampleProvider.hpp>

Inheritance diagram for sgpp::datadriven::FileSampleProvider:
sgpp::datadriven::SampleProvider sgpp::datadriven::ArffFileSampleProvider sgpp::datadriven::CSVFileSampleProvider sgpp::datadriven::FileSampleDecorator

Public Member Functions

virtual size_t getNumSamples () const =0
 Returns the total amount of samples available in the file. More...
 
virtual void readFile (const std::string &filePath)=0
 Read the contents of the file at the given path. More...
 
virtual void readString (const std::string &input)=0
 Read the contents of a string, for example a deflated archive. More...
 
- Public Member Functions inherited from sgpp::datadriven::SampleProvider
virtual SampleProviderclone () const =0
 Clone pattern for polymorphic cloning (mainly interresting for copy constructors). More...
 
virtual DatasetgetAllSamples ()=0
 Asks to return all available samples. More...
 
virtual size_t getDim () const =0
 Returns the maximal dimensionality of the data. More...
 
virtual DatasetgetNextSamples (size_t howMany)=0
 Lets the user request a certain amount of samples. More...
 
SampleProvideroperator= (const SampleProvider &rhs)=default
 
SampleProvideroperator= (SampleProvider &&rhs)=default
 
 SampleProvider ()=default
 
 SampleProvider (const SampleProvider &rhs)=default
 
 SampleProvider (SampleProvider &&rhs)=default
 
virtual ~SampleProvider ()=default
 

Detailed Description

sgpp::datadriven::FileSampleProvider is an specialization of sgpp::datadriven::SampleProvider and provides an interface for all sample providers that get their samples from files.

Member Function Documentation

virtual size_t sgpp::datadriven::FileSampleProvider::getNumSamples ( ) const
pure virtual

Returns the total amount of samples available in the file.

Only works after calling readFile or readString.

Returns
the total amount of samples available in the file.

Implemented in sgpp::datadriven::FileSampleDecorator, sgpp::datadriven::ArffFileSampleProvider, and sgpp::datadriven::CSVFileSampleProvider.

virtual void sgpp::datadriven::FileSampleProvider::readFile ( const std::string &  filePath)
pure virtual

Read the contents of the file at the given path.

Has to throw an exception if file can not be opened or parsed. Results of parsing can be optained via sgpp::datadriven::SampleProvider member functions.

Parameters
filePathvalid path to an existing file.

Implemented in sgpp::datadriven::FileSampleDecorator, sgpp::datadriven::ArffFileSampleProvider, and sgpp::datadriven::CSVFileSampleProvider.

virtual void sgpp::datadriven::FileSampleProvider::readString ( const std::string &  input)
pure virtual

Read the contents of a string, for example a deflated archive.

Has to throw an exception if string can not be parsed. Results of parsing can be optained via sgpp::datadriven::SampleProvider member functions.

Implemented in sgpp::datadriven::ArffFileSampleProvider, sgpp::datadriven::CSVFileSampleProvider, and sgpp::datadriven::FileSampleDecorator.


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