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(RNG &rng) = 0¶
Creates and returns a sample of the available training examples.
- Parameters:
rng – A reference to an object of type
RNG, implementing the random number generator to be used- Returns:
A reference to an object type
WeightVectorthat provides access to the weights of the individual training examples
-
inline virtual ~IInstanceSampling()¶
-
class IInstanceSamplingFactory¶
- #include <instance_sampling.hpp>
Defines an interface for all factories that allow to create instances of the type
IInstanceSampling.Public Functions
-
inline virtual ~IInstanceSamplingFactory()¶
-
virtual std::unique_ptr<IInstanceSampling> create(const CContiguousView<const uint8> &labelMatrix, const SinglePartition &partition, IStatistics &statistics) 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 rules
- 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 = 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 rules
- 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 = 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 rules
- 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 = 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 rules
- Returns:
An unique pointer to an object of type
IInstanceSamplingthat has been created
-
inline virtual ~IInstanceSamplingFactory()¶
-
class IInstanceSamplingConfig¶
- #include <instance_sampling.hpp>
Defines an interface for all classes that allow to configure a method for sampling instances.
Subclassed by ExampleWiseStratifiedInstanceSamplingConfig, InstanceSamplingWithReplacementConfig, InstanceSamplingWithoutReplacementConfig, LabelWiseStratifiedInstanceSamplingConfig, NoInstanceSamplingConfig
Public Functions
-
inline virtual ~IInstanceSamplingConfig()¶
-
virtual std::unique_ptr<IInstanceSamplingFactory> createInstanceSamplingFactory() const = 0¶
Creates and returns a new object of type
IInstanceSamplingFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IInstanceSamplingFactorythat has been created
-
inline virtual ~IInstanceSamplingConfig()¶