shark::LabeledDataDistribution< InputType, LabelType > Class Template Referenceabstract

A LabeledDataDistribution defines a supervised learning problem. More...

#include <shark/Data/DataDistribution.h>

Public Member Functions

virtual ~LabeledDataDistribution ()
 Virtual destructor.
 
virtual void draw (InputType &input, LabelType &label) const =0
 Generates a single pair of input and label.
 
std::pair< InputType, LabelType > operator() ()
 
LabeledData< InputType, LabelType > generateDataset (std::size_t size, std::size_t maximumBatchSize) const
 Generates a dataset with samples from from the distribution.
 
LabeledData< InputType, LabelType > generateDataset (std::size_t size) const
 Generates a data set with samples from from the distribution.
 

Detailed Description

template<class InputType, class LabelType>
class shark::LabeledDataDistribution< InputType, LabelType >

A LabeledDataDistribution defines a supervised learning problem.

The supervised learning problem is defined by an explicit distribution (in contrast to a finite dataset). The only method we need is to draw a sample from the distribution.

Definition at line 108 of file DataDistribution.h.

Constructor & Destructor Documentation

◆ ~LabeledDataDistribution()

template<class InputType , class LabelType >
virtual shark::LabeledDataDistribution< InputType, LabelType >::~LabeledDataDistribution ( )
inlinevirtual

Virtual destructor.

Definition at line 112 of file DataDistribution.h.

Member Function Documentation

◆ draw()

template<class InputType , class LabelType >
virtual void shark::LabeledDataDistribution< InputType, LabelType >::draw ( InputType input,
LabelType &  label 
) const
pure virtual

Generates a single pair of input and label.

Parameters
inputthe generated input
labelthe generated label

Implemented in shark::Wave, shark::Chessboard, shark::PamiToy, shark::CircleInSquare, and shark::DiagonalWithCircle.

Referenced by shark::LabeledDataDistribution< InputType, LabelType >::generateDataset(), and shark::LabeledDataDistribution< InputType, LabelType >::operator()().

◆ generateDataset() [1/2]

template<class InputType , class LabelType >
LabeledData< InputType, LabelType > shark::LabeledDataDistribution< InputType, LabelType >::generateDataset ( std::size_t  size) const
inline

Generates a data set with samples from from the distribution.

Parameters
sizethe number of samples in the dataset

Definition at line 145 of file DataDistribution.h.

References shark::LabeledDataDistribution< InputType, LabelType >::generateDataset().

◆ generateDataset() [2/2]

template<class InputType , class LabelType >
LabeledData< InputType, LabelType > shark::LabeledDataDistribution< InputType, LabelType >::generateDataset ( std::size_t  size,
std::size_t  maximumBatchSize 
) const
inline

Generates a dataset with samples from from the distribution.

Parameters
sizethe number of samples in the dataset
maximumBatchSizethe maximum size of a batch

Definition at line 130 of file DataDistribution.h.

References shark::createLabeledDataFromRange(), and shark::LabeledDataDistribution< InputType, LabelType >::draw().

Referenced by shark::LabeledDataDistribution< InputType, LabelType >::generateDataset(), main(), main(), and run_one_trial().

◆ operator()()

template<class InputType , class LabelType >
std::pair< InputType, LabelType > shark::LabeledDataDistribution< InputType, LabelType >::operator() ( )
inline

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