SG++-Doxygen-Documentation
sgpp::datadriven::SampleProvider Class Referenceabstract

SampleProvider is an abstraction for object that provide sample data from various sources for example datasets from files (ARFF, CSV) or synthetic datasets generated by sampling functions ( Friedmann datasets). More...

#include <SampleProvider.hpp>

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

Public Member Functions

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...
 
virtual size_t getNumSamples () const =0
 Returns the number of samples availible or throws if not possible. More...
 
SampleProvideroperator= (const SampleProvider &rhs)=default
 
SampleProvideroperator= (SampleProvider &&rhs)=default
 
virtual void reset ()=0
 Resets the state of the sample provider (e.g. More...
 
 SampleProvider ()=default
 
 SampleProvider (const SampleProvider &rhs)=default
 
 SampleProvider (SampleProvider &&rhs)=default
 
virtual ~SampleProvider ()=default
 

Detailed Description

SampleProvider is an abstraction for object that provide sample data from various sources for example datasets from files (ARFF, CSV) or synthetic datasets generated by sampling functions ( Friedmann datasets).

Constructor & Destructor Documentation

◆ SampleProvider() [1/3]

sgpp::datadriven::SampleProvider::SampleProvider ( )
default

◆ SampleProvider() [2/3]

sgpp::datadriven::SampleProvider::SampleProvider ( const SampleProvider rhs)
default

◆ SampleProvider() [3/3]

sgpp::datadriven::SampleProvider::SampleProvider ( SampleProvider &&  rhs)
default

◆ ~SampleProvider()

virtual sgpp::datadriven::SampleProvider::~SampleProvider ( )
virtualdefault

Member Function Documentation

◆ clone()

virtual SampleProvider* sgpp::datadriven::SampleProvider::clone ( ) const
pure virtual

Clone pattern for polymorphic cloning (mainly interresting for copy constructors).

Returns
sgpp::datadriven::SampleProvider* pointer to clone of this class. This object is owned by the caller.

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

◆ getAllSamples()

virtual Dataset* sgpp::datadriven::SampleProvider::getAllSamples ( )
pure virtual

Asks to return all available samples.

This functionality is designed for returning all available samples from an entire file.

Returns
sgpp::datadriven::Dataset* Pointer to a new sgpp::datadriven::Dataset object. This object is owned by the caller.

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

◆ getDim()

virtual size_t sgpp::datadriven::SampleProvider::getDim ( ) const
pure virtual

◆ getNextSamples()

virtual Dataset* sgpp::datadriven::SampleProvider::getNextSamples ( size_t  howMany)
pure virtual

Lets the user request a certain amount of samples.

This functionality is is designed for streaming algorithms where data is processed in batches.

Parameters
howManynumber requested amount of samples. The amount of actually provided samples can be smaller, if there is not sufficient data.
Returns
sgpp::datadriven::Dataset* Pointer to a new sgpp::datadriven::Dataset object containing at most the requested amount of samples. This object is owned by the caller.

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

◆ getNumSamples()

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

Returns the number of samples availible or throws if not possible.

Returns
the number of samples availible

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

◆ operator=() [1/2]

SampleProvider& sgpp::datadriven::SampleProvider::operator= ( const SampleProvider rhs)
default

◆ operator=() [2/2]

SampleProvider& sgpp::datadriven::SampleProvider::operator= ( SampleProvider &&  rhs)
default

◆ reset()

virtual void sgpp::datadriven::SampleProvider::reset ( )
pure virtual

Resets the state of the sample provider (e.g.

to start a new epoch)

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


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