File rule_evaluation_label_wise_partial_dynamic.hpp

namespace boosting
class LabelWiseDynamicPartialRuleEvaluationFactory : public boosting::ISparseLabelWiseRuleEvaluationFactory
#include <rule_evaluation_label_wise_partial_dynamic.hpp>

Allows to create instances of the class ISparseLabelWiseRuleEvaluationFactory that allow to calculate the predictions of partial rules, which predict for a subset of the available labels that is determined dynamically.

Public Functions

LabelWiseDynamicPartialRuleEvaluationFactory(float32 threshold, float32 exponent, float64 l1RegularizationWeight, float64 l2RegularizationWeight)
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)

  • 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

  • l1RegularizationWeight – The weight of the L1 regularization that is applied for calculating the scores to be predicted by rules

  • l2RegularizationWeight – The weight of the L2 regularization that is applied for calculating the scores to be predicted by rules

virtual std::unique_ptr<IRuleEvaluation<DenseLabelWiseStatisticVector>> create(const DenseLabelWiseStatisticVector &statisticVector, const CompleteIndexVector &indexVector) const override

Creates a new instance of the class IRuleEvaluation that allows to calculate the predictions of rules that predict for all available labels, based on the gradients and Hessians that are stored by a DenseLabelWiseStatisticVector.

Parameters:
  • statisticVector – A reference to an object of type DenseLabelWiseStatisticVector. This vector is only used to identify the function that is able to deal with this particular type of vector via function overloading

  • indexVector – A reference to an object of the type CompleteIndexVector that provides access to the indices of the labels for which the rules may predict

Returns:

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

virtual std::unique_ptr<IRuleEvaluation<DenseLabelWiseStatisticVector>> create(const DenseLabelWiseStatisticVector &statisticVector, const PartialIndexVector &indexVector) const override

Creates a new instance of the class IRuleEvaluation that allows to calculate the predictions of rules that predict for a subset of the available labels, based on the gradients and Hessians that are stored by a DenseLabelWiseStatisticVector.

Parameters:
  • statisticVector – A reference to an object of type DenseLabelWiseStatisticVector. This vector is only used to identify the function that is able to deal with this particular type of vector via function overloading

  • indexVector – A reference to an object of the type PartialIndexVector that provides access to the indices of the labels for which the rules may predict

Returns:

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

virtual std::unique_ptr<IRuleEvaluation<SparseLabelWiseStatisticVector>> create(const SparseLabelWiseStatisticVector &statisticVector, const CompleteIndexVector &indexVector) const override

Creates a new instance of the class IRuleEvaluation that allows to calculate the predictions of rules that predict for all available labels, based on the gradients and Hessians that are stored by a SparseLabelWiseStatisticVector.

Parameters:
  • statisticVector – A reference to an object of type SparseLabelWiseStatisticVector. This vector is only used to identify the function that is able to deal with this particular type of vector via function overloading

  • indexVector – A reference to an object of the type CompleteIndexVector that provides access to the indices of the labels for which the rules may predict

Returns:

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

virtual std::unique_ptr<IRuleEvaluation<SparseLabelWiseStatisticVector>> create(const SparseLabelWiseStatisticVector &statisticVector, const PartialIndexVector &indexVector) const override

Creates a new instance of the class IRuleEvaluation that allows to calculate the predictions of rules that predict for a subset of the available labels, based on the gradients and Hessians that are stored by a SparseLabelWiseStatisticVector.

Parameters:
  • statisticVector – A reference to an object of type SparseLabelWiseStatisticVector. This vector is only used to identify the function that is able to deal with this particular type of vector via function overloading

  • indexVector – A reference to an object of the type PartialIndexVector that provides access to the indices of the labels for which the rules may predict

Returns:

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

Private Members

const float32 threshold_
const float32 exponent_
const float64 l1RegularizationWeight_
const float64 l2RegularizationWeight_