File label_binning_equal_width.hpp

namespace boosting
class IEqualWidthLabelBinningConfig
#include <label_binning_equal_width.hpp>

Defines an interface for all classes that allow to configure a method that assigns labels to bins in a way such that each bin contains labels for which the predicted score is expected to belong to the same value range.

Subclassed by boosting::EqualWidthLabelBinningConfig

Public Functions

inline virtual ~IEqualWidthLabelBinningConfig()
virtual float32 getBinRatio() const = 0

Returns the percentage that specifies how many bins are used.

Returns:

The percentage that specifies how many bins are used

virtual IEqualWidthLabelBinningConfig &setBinRatio(float32 binRatio) = 0

Sets the percentage that specifies how many should be used.

Parameters:

binRatio – A percentage that specifies how many bins should be used, e.g., if 100 labels are available, a percentage of 0.5 means that ceil(0.5 * 100) = 50 bins should be used. Must be in (0, 1)

Returns:

A reference to an object of type EqualWidthLabelBinningConfig that allows further configuration of the method that assigns labels to bins

virtual uint32 getMinBins() const = 0

Returns the minimum number of bins that is used.

Returns:

The minimum number of bins that is used

virtual IEqualWidthLabelBinningConfig &setMinBins(uint32 minBins) = 0

Sets the minimum number of bins that should be used.

Parameters:

minBins – The minimum number of bins that should be used. Must be at least 1

Returns:

A reference to an object of type EqualWidthLabelBinningConfig that allows further configuration of the method that assigns labels to bins

virtual uint32 getMaxBins() const = 0

Returns the maximum number of bins that is used.

Returns:

The maximum number of bins that is used

virtual IEqualWidthLabelBinningConfig &setMaxBins(uint32 maxBins) = 0

Sets the maximum number of bins that should be used.

Parameters:

maxBins – The maximum number of bins that should be used. Must be at least the minimum number of bins or 0, if the maximum number of bins should not be restricted

Returns:

A reference to an object of type EqualWidthLabelBinningConfig that allows further configuration of the method that assigns labels to bins

class EqualWidthLabelBinningConfig : public boosting::ILabelBinningConfig, public boosting::IEqualWidthLabelBinningConfig
#include <label_binning_equal_width.hpp>

Allows to configure a method that assigns labels to bins in a way such that each bin contains labels for which the predicted score is expected to belong to the same value range.

Public Functions

EqualWidthLabelBinningConfig(ReadableProperty<IRegularizationConfig> l1RegularizationConfig, ReadableProperty<IRegularizationConfig> l2RegularizationConfig)
Parameters:
  • l1RegularizationConfig – A ReadableProperty that allows to access the IRegularizationConfig that stores the configuration of the L1 regularization

  • l2RegularizationConfig – A ReadableProperty that allows to access the IRegularizationConfig that stores the configuration of the L2 regularization

virtual float32 getBinRatio() const override

Returns the percentage that specifies how many bins are used.

Returns:

The percentage that specifies how many bins are used

virtual IEqualWidthLabelBinningConfig &setBinRatio(float32 binRatio) override

Sets the percentage that specifies how many should be used.

Parameters:

binRatio – A percentage that specifies how many bins should be used, e.g., if 100 labels are available, a percentage of 0.5 means that ceil(0.5 * 100) = 50 bins should be used. Must be in (0, 1)

Returns:

A reference to an object of type EqualWidthLabelBinningConfig that allows further configuration of the method that assigns labels to bins

virtual uint32 getMinBins() const override

Returns the minimum number of bins that is used.

Returns:

The minimum number of bins that is used

virtual IEqualWidthLabelBinningConfig &setMinBins(uint32 minBins) override

Sets the minimum number of bins that should be used.

Parameters:

minBins – The minimum number of bins that should be used. Must be at least 1

Returns:

A reference to an object of type EqualWidthLabelBinningConfig that allows further configuration of the method that assigns labels to bins

virtual uint32 getMaxBins() const override

Returns the maximum number of bins that is used.

Returns:

The maximum number of bins that is used

virtual IEqualWidthLabelBinningConfig &setMaxBins(uint32 maxBins) override

Sets the maximum number of bins that should be used.

Parameters:

maxBins – The maximum number of bins that should be used. Must be at least the minimum number of bins or 0, if the maximum number of bins should not be restricted

Returns:

A reference to an object of type EqualWidthLabelBinningConfig that allows further configuration of the method that assigns labels to bins

virtual std::unique_ptr<IDecomposableRuleEvaluationFactory> createDecomposableCompleteRuleEvaluationFactory() const override

Creates and returns a new object of type IDecomposableRuleEvaluationFactory that allows to calculate the predictions of complete rules according to the specified configuration.

Returns:

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

virtual std::unique_ptr<ISparseDecomposableRuleEvaluationFactory> createDecomposableFixedPartialRuleEvaluationFactory(float32 outputRatio, uint32 minOutputs, uint32 maxOutputs) const override

Creates and returns a new object of type ISparseDecomposableRuleEvaluationFactory that allows to calculate the prediction of partial rules, which predict for a predefined number of outputs, according to the specified configuration.

Parameters:
  • outputRatio – A percentage that specifies for how many outputs the rule heads should predict

  • minOutputs – The minimum number of outputs for which the rule heads should predict

  • maxOutputs – The maximum number of outputs for which the rule heads should predict

Returns:

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

virtual std::unique_ptr<ISparseDecomposableRuleEvaluationFactory> createDecomposableDynamicPartialRuleEvaluationFactory(float32 threshold, float32 exponent) const override

Creates and returns a new object of type ISparseDecomposableRuleEvaluationFactory that allows to calculate the prediction of partial rules, which predict for a subset of the available outputs that is determined dynamically, according to the specified configuration.

Parameters:
  • threshold – A threshold that affects for how many outputs the rule heads should predict

  • exponent – An exponent that is used to weigh the estimated predictive quality for individual outputs

Returns:

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

virtual std::unique_ptr<INonDecomposableRuleEvaluationFactory> createNonDecomposableCompleteRuleEvaluationFactory(const BlasFactory &blasFactory, const LapackFactory &lapackFactory) const override

Creates and returns a new object of type INonDecomposableRuleEvaluationFactory that allows to calculate the predictions of complete rules according to the specified configuration.

Parameters:
  • blasFactory – A reference to an object of type BlasFactory that allows to create objects for executing BLAS routines

  • lapackFactory – A reference to an object of type LapackFactory that allows to create objects for executing LAPACK routines

Returns:

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

virtual std::unique_ptr<INonDecomposableRuleEvaluationFactory> createNonDecomposableFixedPartialRuleEvaluationFactory(float32 outputRatio, uint32 minOutputs, uint32 maxOutputs, const BlasFactory &blasFactory, const LapackFactory &lapackFactory) const override

Creates and returns a new object of type INonDecomposableRuleEvaluationFactory that allows to calculate the predictions of partial rules, which predict for a predefined number of outputs, according to the specified configuration.

Parameters:
  • outputRatio – A percentage that specifies for how many outputs the rule heads should predict

  • minOutputs – The minimum number of outputs for which the rule heads should predict

  • maxOutputs – The maximum number of outputs for which the rule heads should predict

  • blasFactory – A reference to an object of type BlasFactory that allows to create objects for executing BLAS routines

  • lapackFactory – A reference to an object of type LapackFactory that allows to create objects for executing LAPACK routines

Returns:

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

virtual std::unique_ptr<INonDecomposableRuleEvaluationFactory> createNonDecomposableDynamicPartialRuleEvaluationFactory(float32 threshold, float32 exponent, const BlasFactory &blasFactory, const LapackFactory &lapackFactory) const override

Creates and returns a new object of type INonDecomposableRuleEvaluationFactory that allows to calculate the predictions of partial rules, which predict for a subset of the available labels that is determined dynamically, according to the specified configuration.

Parameters:
  • threshold – A threshold that affects for how many labels the rule heads should predict

  • exponent – An exponent that is used to weigh the estimated predictive quality for individual labels

  • blasFactory – A reference to an object of type BlasFactory that allows to create objects for executing BLAS routines

  • lapackFactory – A reference to an object of type LapackFactory that allows to create objects for executing LAPACK routines

Returns:

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

Private Members

float32 binRatio_
uint32 minBins_
uint32 maxBins_
const ReadableProperty<IRegularizationConfig> l1RegularizationConfig_
const ReadableProperty<IRegularizationConfig> l2RegularizationConfig_