File instance_sampling.hpp

class IInstanceSampling
#include <instance_sampling.hpp>

Defines an interface for all classes that implement a method for sampling training examples.

Public Functions

inline virtual ~IInstanceSampling()
virtual const IWeightVector &sample() = 0

Creates and returns a sample of the available training examples.

Returns:

A reference to an object of type IWeightVector that provides access to the weights of the training examples in the sample

class IClassificationInstanceSamplingFactory
#include <instance_sampling.hpp>

Defines an interface for all factories that allow to create instances of the type IInstanceSampling that can be used in classification problems.

Public Functions

inline virtual ~IClassificationInstanceSamplingFactory()
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const uint8> &labelMatrix, const SinglePartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type CContiguousView that provides access to the labels of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const uint8> &labelMatrix, const SinglePartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type CContiguousView that provides access to the labels of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const uint8> &labelMatrix, BiPartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type CContiguousView that provides access to the labels of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const uint8> &labelMatrix, BiPartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type CContiguousView that provides access to the labels of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const BinaryCsrView &labelMatrix, const SinglePartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type BinaryCsrView that provides access to the labels of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const BinaryCsrView &labelMatrix, const SinglePartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type BinaryCsrView that provides access to the labels of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const BinaryCsrView &labelMatrix, BiPartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type BinaryCsrView that provides access to the labels of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const BinaryCsrView &labelMatrix, BiPartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • labelMatrix – A reference to an object of type BinaryCsrView that provides access to the labels of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

class IRegressionInstanceSamplingFactory
#include <instance_sampling.hpp>

Defines an interface for all factories that allow to create instances of the type IInstanceSampling that can be used in regression problems.

Public Functions

inline virtual ~IRegressionInstanceSamplingFactory()
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> &regressionMatrix, const SinglePartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CContiguousView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> &regressionMatrix, const SinglePartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CContiguousView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> &regressionMatrix, BiPartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CContiguousView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> &regressionMatrix, BiPartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CContiguousView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> &regressionMatrix, const SinglePartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CsrView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> &regressionMatrix, const SinglePartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CsrView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type SinglePartition that provides access to the indices of the training examples that are included in the training set

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> &regressionMatrix, BiPartition &partition, IStatistics &statistics, const EqualWeightVector &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CsrView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> &regressionMatrix, BiPartition &partition, IStatistics &statistics, const DenseWeightVector<float32> &exampleWeights) const = 0

Creates and returns a new object of type IInstanceSampling.

Parameters:
  • regressionMatrix – A reference to an object of type CsrView that provides access to the regression scores of the training examples

  • partition – A reference to an object of type BiPartition that provides access to the indices of the training examples that are included in the training set and the holdout set, respectively

  • statistics – A reference to an object of type IStatistics that provides access to the statistics which serve as a basis for learning rules

  • exampleWeights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

class IClassificationInstanceSamplingConfig
#include <instance_sampling.hpp>

Defines an interface for all classes that allow to configure a method for sampling instances that can be used in classification problems.

Subclassed by ExampleWiseStratifiedInstanceSamplingConfig, InstanceSamplingWithReplacementConfig, InstanceSamplingWithoutReplacementConfig, NoInstanceSamplingConfig, OutputWiseStratifiedInstanceSamplingConfig

Public Functions

inline virtual ~IClassificationInstanceSamplingConfig()
virtual std::unique_ptr<IClassificationInstanceSamplingFactory> createClassificationInstanceSamplingFactory() const = 0

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

Returns:

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

class IRegressionInstanceSamplingConfig
#include <instance_sampling.hpp>

Defines an interface for all classes that allow to configure a method for sampling instances that can be used in regression problems.

Subclassed by InstanceSamplingWithReplacementConfig, InstanceSamplingWithoutReplacementConfig, NoInstanceSamplingConfig

Public Functions

inline virtual ~IRegressionInstanceSamplingConfig()
virtual std::unique_ptr<IRegressionInstanceSamplingFactory> createRegressionInstanceSamplingFactory() const = 0

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

Returns:

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