File head_type_auto.hpp

namespace boosting
class AutomaticHeadConfig : public boosting::IHeadConfig
#include <head_type_auto.hpp>

Allows to configure a method that automatically decides for the type of rule heads to be used.

Public Functions

AutomaticHeadConfig(const std::unique_ptr<ILossConfig> &lossConfigPtr, const std::unique_ptr<ILabelBinningConfig> &labelBinningConfigPtr, const std::unique_ptr<IMultiThreadingConfig> &multiThreadingConfigPtr, const std::unique_ptr<IRegularizationConfig> &l1RegularizationConfigPtr, const std::unique_ptr<IRegularizationConfig> &l2RegularizationConfigPtr)
Parameters:
  • lossConfigPtr – A reference to an unique pointer that stores the configuration of the loss function

  • 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

  • l1RegularizationConfigPtr – A reference to an unique pointer that stores the configuration of the L1 regularization

  • l2RegularizationConfigPtr – A reference to an unique pointer that stores the configuration of the L2 regularization

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

const std::unique_ptr<ILossConfig> &lossConfigPtr_
const std::unique_ptr<ILabelBinningConfig> &labelBinningConfigPtr_
const std::unique_ptr<IMultiThreadingConfig> &multiThreadingConfigPtr_
const std::unique_ptr<IRegularizationConfig> &l1RegularizationConfigPtr_
const std::unique_ptr<IRegularizationConfig> &l2RegularizationConfigPtr_