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
IWeightVectorthat provides access to the weights of the training examples in the sample
-
inline virtual ~IInstanceSampling()¶
-
class IClassificationInstanceSamplingFactory¶
- #include <instance_sampling.hpp>
Defines an interface for all factories that allow to create instances of the type
IInstanceSamplingthat 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
CContiguousViewthat provides access to the labels of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat 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
CContiguousViewthat provides access to the labels of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat 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
CContiguousViewthat provides access to the labels of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat 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
CContiguousViewthat provides access to the labels of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat 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
BinaryCsrViewthat provides access to the labels of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat 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
BinaryCsrViewthat provides access to the labels of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat 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
BinaryCsrViewthat provides access to the labels of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat 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
BinaryCsrViewthat provides access to the labels of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat has been created
-
inline virtual ~IClassificationInstanceSamplingFactory()¶
-
class IRegressionInstanceSamplingFactory¶
- #include <instance_sampling.hpp>
Defines an interface for all factories that allow to create instances of the type
IInstanceSamplingthat can be used in regression problems.Public Functions
-
inline virtual ~IRegressionInstanceSamplingFactory()¶
-
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> ®ressionMatrix, 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
CContiguousViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> ®ressionMatrix, 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
CContiguousViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> ®ressionMatrix, 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
CContiguousViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const float32> ®ressionMatrix, 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
CContiguousViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> ®ressionMatrix, 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
CsrViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> ®ressionMatrix, 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
CsrViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
SinglePartitionthat provides access to the indices of the training examples that are included in the training setstatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> ®ressionMatrix, 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
CsrViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – A reference to an object of type
EqualWeightVectorthat provides access to the weights of individual training examples
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
virtual std::unique_ptr<IInstanceSampling> create(const CsrView<const float32> ®ressionMatrix, 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
CsrViewthat provides access to the regression scores of the training examplespartition – A reference to an object of type
BiPartitionthat provides access to the indices of the training examples that are included in the training set and the holdout set, respectivelystatistics – A reference to an object of type
IStatisticsthat provides access to the statistics which serve as a basis for learning rulesexampleWeights – 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
IInstanceSamplingthat has been created
-
inline virtual ~IRegressionInstanceSamplingFactory()¶
-
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
IClassificationInstanceSamplingFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IClassificationInstanceSamplingFactorythat has been created
-
inline virtual ~IClassificationInstanceSamplingConfig()¶
-
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
IRegressionInstanceSamplingFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IRegressionInstanceSamplingFactorythat has been created
-
inline virtual ~IRegressionInstanceSamplingConfig()¶