File head_type_partial_dynamic.hpp

namespace boosting
class IDynamicPartialHeadConfig
#include <head_type_partial_dynamic.hpp>

Defines an interface for all classes that allow to configure partial rule heads that predict for a subset of the available labels that is determined dynamically. Only those labels for which the square of the predictive quality exceeds a certain threshold are included in a rule head.

Subclassed by boosting::DynamicPartialHeadConfig

Public Functions

inline virtual ~IDynamicPartialHeadConfig()
virtual float32 getThreshold() const = 0

Returns the threshold that affects for how many labels the rule heads predict.

Returns:

The threshold that affects for how many labels the rule heads predict

virtual IDynamicPartialHeadConfig &setThreshold(float32 threshold) = 0

Sets the threshold that affects for how many labels the rule heads should predict.

Parameters:

threshold – A threshold that affects for how many labels the rule heads should predict. A smaller threshold results in less labels being selected. A greater threshold results in more labels being selected. E.g., a threshold of 0.2 means that a rule will only predict for a label if the estimated predictive quality q for this particular label satisfies the inequality q^exponent > q_best^exponent * (1 - 0.2), where q_best is the best quality among all labels. Must be in (0, 1)

Returns:

A reference to an object of type IDynamicPartialHeadConfig that allows further configuration of the rule heads

virtual float32 getExponent() const = 0

Sets the exponent that is used to weigh the estimated predictive quality for individual labels.

Returns:

The exponent that is used to weight the estimated predictive quality for individual labels

virtual IDynamicPartialHeadConfig &setExponent(float32 exponent) = 0

Sets the exponent that should be used to weigh the estimated predictive quality for individual labels.

Parameters:

exponent – An exponent that should be used to weigh the estimated predictive quality for individual labels. E.g., an exponent of 2 means that the estimated predictive quality q for a particular label is weighed as q^2. Must be at least 1

Returns:

A reference to an object of type IDynamicPartialHeadConfig that allows further configuration of the rule heads

class DynamicPartialHeadConfig : public boosting::IHeadConfig, public boosting::IDynamicPartialHeadConfig
#include <head_type_partial_dynamic.hpp>

Allows to configure partial rule heads that predict for a for a subset of the available labels that is determined dynamically. Only those labels for which the square of the predictive quality exceeds a certain threshold are included in a rule head.

Public Functions

DynamicPartialHeadConfig(const std::unique_ptr<ILabelBinningConfig> &labelBinningConfigPtr, const std::unique_ptr<IMultiThreadingConfig> &multiThreadingConfigPtr)
Parameters:
  • labelBinningConfigPtr – A reference to an unique pointer that stores the configuration of the method for assigning labels to bins

  • multiThreadingConfigPtr – A reference to an unique pointer that stores the configuration of the multi-threading behavior that should be used for the parallel update of statistics

virtual float32 getThreshold() const override

Returns the threshold that affects for how many labels the rule heads predict.

Returns:

The threshold that affects for how many labels the rule heads predict

virtual IDynamicPartialHeadConfig &setThreshold(float32 threshold) override

Sets the threshold that affects for how many labels the rule heads should predict.

Parameters:

threshold – A threshold that affects for how many labels the rule heads should predict. A smaller threshold results in less labels being selected. A greater threshold results in more labels being selected. E.g., a threshold of 0.2 means that a rule will only predict for a label if the estimated predictive quality q for this particular label satisfies the inequality q^exponent > q_best^exponent * (1 - 0.2), where q_best is the best quality among all labels. Must be in (0, 1)

Returns:

A reference to an object of type IDynamicPartialHeadConfig that allows further configuration of the rule heads

virtual float32 getExponent() const override

Sets the exponent that is used to weigh the estimated predictive quality for individual labels.

Returns:

The exponent that is used to weight the estimated predictive quality for individual labels

virtual IDynamicPartialHeadConfig &setExponent(float32 exponent) override

Sets the exponent that should be used to weigh the estimated predictive quality for individual labels.

Parameters:

exponent – An exponent that should be used to weigh the estimated predictive quality for individual labels. E.g., an exponent of 2 means that the estimated predictive quality q for a particular label is weighed as q^2. Must be at least 1

Returns:

A reference to an object of type IDynamicPartialHeadConfig that allows further configuration of the rule heads

virtual std::unique_ptr<IStatisticsProviderFactory> createStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix, const ILabelWiseLossConfig &lossConfig) const override

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

Parameters:
  • featureMatrix – A reference to an object of type IFeatureMatrix that provides access to the feature values of the training examples

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

  • lossConfig – A reference to an object of type ILabelWiseLossConfig that specifies the configuration of the loss function

Returns:

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

virtual std::unique_ptr<IStatisticsProviderFactory> createStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix, const ISparseLabelWiseLossConfig &lossConfig) const override

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

Parameters:
  • featureMatrix – A reference to an object of type IFeatureMatrix that provides access to the feature values of the training examples

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

  • lossConfig – A reference to an object of type ISparseLabelWiseLossConfig that specifies the configuration of the loss function

Returns:

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

virtual std::unique_ptr<IStatisticsProviderFactory> createStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix, const IExampleWiseLossConfig &lossConfig, const Blas &blas, const Lapack &lapack) const override

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

Parameters:
  • featureMatrix – A reference to an object of type IFeatureMatrix that provides access to the feature values of the training examples

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

  • lossConfig – A reference to an object of type IExampleWiseLossConfig that specifies the configuration of the loss function

  • blas – A reference to an object of type Blas that allows to execute BLAS routines

  • lapack – A reference to an object of type Lapack that allows to execute LAPACK routines

Returns:

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

virtual bool isPartial() const override

Returns, whether the heads of rules are partial, i.e., they predict for a subset of the available labels, or not.

Returns:

True, if the heads of rules are partial, false otherwise

virtual bool isSingleLabel() const override

Returns whether the rule heads predict for a single label or not.

Returns:

True, if the rule heads predict for a single label, false otherwise

Private Members

float32 threshold_
float32 exponent_
const std::unique_ptr<ILabelBinningConfig> &labelBinningConfigPtr_
const std::unique_ptr<IMultiThreadingConfig> &multiThreadingConfigPtr_