File rule_evaluation_decomposable_partial_fixed.hpp

namespace boosting
class DecomposableFixedPartialRuleEvaluationFactory : public boosting::ISparseDecomposableRuleEvaluationFactory
#include <rule_evaluation_decomposable_partial_fixed.hpp>

Allows to create instances of the class ISparseDecomposableRuleEvaluationFactory that allow to calculate the predictions of partial rules, which predict for a predefined number of outputs.

Public Functions

DecomposableFixedPartialRuleEvaluationFactory(float32 outputRatio, uint32 minOutputs, uint32 maxOutputs, float32 l1RegularizationWeight, float32 l2RegularizationWeight)
Parameters:
  • outputRatio – A percentage that specifies for how many outputs the rule heads should predict, e.g., if 100 outputs are available, a percentage of 0.5 means that the rule heads predict for a subset of ceil(0.5 * 100) = 50 outputs. Must be in (0, 1)

  • minOutputs – The minimum number of outputs for which the rule heads should predict. Must be at least 2

  • maxOutputs – The maximum number of outputs for which the rule heads should predict. Must be at least minOutputs or 0, if the maximum number of outputs should not be restricted

  • 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<DenseDecomposableStatisticVector<float32>>> create(const DenseDecomposableStatisticVector<float32> &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 outputs, based on the gradients and Hessians that are stored by a DenseDecomposableStatisticVector<float32>.

Parameters:
  • statisticVector – A reference to an object of type DenseDecomposableStatisticVector<float32>. 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 outputs 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<DenseDecomposableStatisticVector<float32>>> create(const DenseDecomposableStatisticVector<float32> &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 outputs, based on the gradients and Hessians that are stored by a DenseDecomposableStatisticVector<float32>.

Parameters:
  • statisticVector – A reference to an object of type DenseDecomposableStatisticVector<float32>. 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 outputs 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<DenseDecomposableStatisticVector<float64>>> create(const DenseDecomposableStatisticVector<float64> &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 outputs, based on the gradients and Hessians that are stored by a DenseDecomposableStatisticVector<float64>.

Parameters:
  • statisticVector – A reference to an object of type DenseDecomposableStatisticVector<float64>. 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 outputs 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<DenseDecomposableStatisticVector<float64>>> create(const DenseDecomposableStatisticVector<float64> &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 outputs, based on the gradients and Hessians that are stored by a DenseDecomposableStatisticVector<float64>.

Parameters:
  • statisticVector – A reference to an object of type DenseDecomposableStatisticVector<float64>. 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 outputs 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<SparseDecomposableStatisticVector<float32, uint32>>> create(const SparseDecomposableStatisticVector<float32, uint32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float32, uint32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float32, uint32>. 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 outputs 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<SparseDecomposableStatisticVector<float32, uint32>>> create(const SparseDecomposableStatisticVector<float32, uint32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float32, uint32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float32, uint32>. 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 outputs 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<SparseDecomposableStatisticVector<float32, float32>>> create(const SparseDecomposableStatisticVector<float32, float32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float32, float32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float32, float32>. 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 outputs 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<SparseDecomposableStatisticVector<float32, float32>>> create(const SparseDecomposableStatisticVector<float32, float32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float32, float32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float32, float32>. 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 outputs 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<SparseDecomposableStatisticVector<float64, uint32>>> create(const SparseDecomposableStatisticVector<float64, uint32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float64, uint32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float64, uint32>. 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 outputs 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<SparseDecomposableStatisticVector<float64, uint32>>> create(const SparseDecomposableStatisticVector<float64, uint32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float64, uint32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float64, uint32>. 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 outputs 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<SparseDecomposableStatisticVector<float64, float32>>> create(const SparseDecomposableStatisticVector<float64, float32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float64, float32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float64, float32>. 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 outputs 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<SparseDecomposableStatisticVector<float64, float32>>> create(const SparseDecomposableStatisticVector<float64, float32> &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 outputs, based on the gradients and Hessians that are stored by a SparseDecomposableStatisticVector<float64, float32>.

Parameters:
  • statisticVector – A reference to an object of type SparseDecomposableStatisticVector<float64, float32>. 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 outputs for which the rules may predict

Returns:

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

Private Members

const float32 outputRatio_
const uint32 minOutputs_
const uint32 maxOutputs_
const float32 l1RegularizationWeight_
const float32 l2RegularizationWeight_