File output_sampling_without_replacement.hpp

class IOutputSamplingWithoutReplacementConfig
#include <output_sampling_without_replacement.hpp>

Defines an interface for all classes that allow to configure a method for sampling outputs without replacement.

Subclassed by OutputSamplingWithoutReplacementConfig

Public Functions

inline virtual ~IOutputSamplingWithoutReplacementConfig()
virtual float32 getSampleSize() const = 0

Returns the fraction of outputs that are included in a sample.

Returns:

The fraction of outputs that are included in a sample

virtual IOutputSamplingWithoutReplacementConfig &setSampleSize(float32 sampleSize) = 0

Sets the fraction of outputs that should be included in a sample.

Parameters:

sampleSize – The fraction of outputs that should be included in a sample, e.g., a value of 0.6 corresponds to 60 % of the available outputs. Must be in (0, 1)

Returns:

A reference to an object of type IOutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

virtual uint32 getMinSamples() const = 0

Returns the minimum number of outputs that are included in a sample.

Returns:

The minimum number of outputs that are included in a sample

virtual IOutputSamplingWithoutReplacementConfig &setMinSamples(uint32 minSamples) = 0

Sets the minimum number of outputs that should be included in a sample.

Parameters:

minSamples – The minimum number of outputs that should be included in a sample. Must be at least 1

Returns:

A reference to an object of type IOutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

virtual uint32 getMaxSamples() const = 0

Returns the maximum number of outputs that are included in a sample.

Returns:

The maximum number of outputs that are included in a sample

virtual IOutputSamplingWithoutReplacementConfig &setMaxSamples(uint32 maxSamples) = 0

Sets the maximum number of outputs that should be included in a sample.

Parameters:

maxSamples – The maximum number of outputs that should be included in a sample. Must be at the value returned by getMaxSamples or 0, if the number of outputs should not be restricted

Returns:

A reference to an object of type IOutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

class OutputSamplingWithoutReplacementConfig : public IOutputSamplingConfig, public IOutputSamplingWithoutReplacementConfig
#include <output_sampling_without_replacement.hpp>

Allows to configure a method for sampling outputs without replacement.

Public Functions

OutputSamplingWithoutReplacementConfig(ReadableProperty<RNGConfig> rngConfig)
Parameters:

rngConfig – A ReadableProperty that provides access to the RNGConfig that stores the configuration of random number generators

virtual float32 getSampleSize() const override

Returns the fraction of outputs that are included in a sample.

Returns:

The fraction of outputs that are included in a sample

virtual IOutputSamplingWithoutReplacementConfig &setSampleSize(float32 sampleSize) override

Sets the fraction of outputs that should be included in a sample.

Parameters:

sampleSize – The fraction of outputs that should be included in a sample, e.g., a value of 0.6 corresponds to 60 % of the available outputs. Must be in (0, 1)

Returns:

A reference to an object of type IOutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

virtual uint32 getMinSamples() const override

Returns the minimum number of outputs that are included in a sample.

Returns:

The minimum number of outputs that are included in a sample

virtual IOutputSamplingWithoutReplacementConfig &setMinSamples(uint32 minSamples) override

Sets the minimum number of outputs that should be included in a sample.

Parameters:

minSamples – The minimum number of outputs that should be included in a sample. Must be at least 1

Returns:

A reference to an object of type IOutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

virtual uint32 getMaxSamples() const override

Returns the maximum number of outputs that are included in a sample.

Returns:

The maximum number of outputs that are included in a sample

virtual IOutputSamplingWithoutReplacementConfig &setMaxSamples(uint32 maxSamples) override

Sets the maximum number of outputs that should be included in a sample.

Parameters:

maxSamples – The maximum number of outputs that should be included in a sample. Must be at the value returned by getMaxSamples or 0, if the number of outputs should not be restricted

Returns:

A reference to an object of type IOutputSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

virtual std::unique_ptr<IOutputSamplingFactory> createOutputSamplingFactory(const IOutputMatrix &outputMatrix) const override

Creates and returns a new object of type IOutputSamplingFactory according to the specified configuration.

Parameters:

outputMatrix – A reference to an object of type IOutputMatrix that provides access to the ground truth of the training examples

Returns:

An unique pointer to an object of type IOutputSamplingFactory that has been created

Private Members

const ReadableProperty<RNGConfig> rngConfig_
float32 sampleSize_
uint32 minSamples_
uint32 maxSamples_