File loss_non_decomposable.hpp

namespace boosting
template<typename StatisticType>
class INonDecomposableClassificationLoss : public virtual boosting::IClassificationLoss<StatisticType>, public virtual boosting::IDecomposableClassificationLoss<StatisticType>
#include <loss_non_decomposable.hpp>

Defines an interface for all non-decomposable loss functions that can be used in classification problems.

Template Parameters:

StatisticType – The type of the gradients and Hessians that are calculated by the loss function

Public Functions

inline virtual ~INonDecomposableClassificationLoss() override
virtual void updateNonDecomposableStatistics(uint32 exampleIndex, const CContiguousView<const uint8> &labelMatrix, const CContiguousView<StatisticType> &scoreMatrix, DenseNonDecomposableStatisticView<StatisticType> &statisticView) const = 0

Updates the statistics of the example at a specific index.

Parameters:
  • exampleIndex – The index of the example for which the gradients and Hessians should be updated

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

  • scoreMatrix – A reference to an object of type CContiguousView that stores the currently predicted scores

  • statisticView – A reference to an object of type DenseNonDecomposableStatisticView to be updated

virtual void updateNonDecomposableStatistics(uint32 exampleIndex, const BinaryCsrView &labelMatrix, const CContiguousView<StatisticType> &scoreMatrix, DenseNonDecomposableStatisticView<StatisticType> &statisticView) const = 0

Updates the statistics of the example at a specific index.

Parameters:
  • exampleIndex – The index of the example for which the gradients and Hessians should be updated

  • labelMatrix – A reference to an object of type BinaryCsrView that provides row-wise access to the labels of the training examples

  • scoreMatrix – A reference to an object of type CContiguousView that stores the currently predicted scores

  • statisticView – A reference to an object of type DenseNonDecomposableStatisticView to be updated

template<typename StatisticType>
class INonDecomposableRegressionLoss : public virtual boosting::IRegressionLoss<StatisticType>, public virtual boosting::IDecomposableRegressionLoss<StatisticType>
#include <loss_non_decomposable.hpp>

Defines an interface for all non-decomposable loss functions that can be used in regression problems.

Template Parameters:

StatisticType – The type of the gradients and Hessians that are calculated by the loss function

Public Functions

inline virtual ~INonDecomposableRegressionLoss() override
virtual void updateNonDecomposableStatistics(uint32 exampleIndex, const CContiguousView<const float32> &regressionMatrix, const CContiguousView<StatisticType> &scoreMatrix, DenseNonDecomposableStatisticView<StatisticType> &statisticView) const = 0

Updates the statistics of the example at a specific index.

Parameters:
  • exampleIndex – The index of the example for which the gradients and Hessians should be updated

  • regressionMatrix – A reference to an object of type CContiguousView that provides random access to the regression scores of the training examples

  • scoreMatrix – A reference to an object of type CContiguousView that stores the currently predicted scores

  • statisticView – A reference to an object of type DenseNonDecomposableStatisticView to be updated

virtual void updateNonDecomposableStatistics(uint32 exampleIndex, const CsrView<const float32> &regressionMatrix, const CContiguousView<StatisticType> &scoreMatrix, DenseNonDecomposableStatisticView<StatisticType> &statisticView) const = 0

Updates the statistics of the example at a specific index.

Parameters:
  • exampleIndex – The index of the example for which the gradients and Hessians should be updated

  • regressionMatrix – A reference to an object of type CsrView that provides row-wise access to the regression scores of the training examples

  • scoreMatrix – A reference to an object of type CContiguousView that stores the currently predicted scores

  • statisticView – A reference to an object of type DenseNonDecomposableStatisticView to be updated

template<typename StatisticType>
class INonDecomposableClassificationLossFactory : public boosting::IDecomposableClassificationLossFactory<StatisticType>
#include <loss_non_decomposable.hpp>

Defines an interface for all factories that allow to create instances of the type INonDecomposableClassificationLoss.

Template Parameters:

StatisticType – The type of the gradients and Hessians that are calculated by the loss function

Public Functions

inline virtual ~INonDecomposableClassificationLossFactory() override
virtual std::unique_ptr<INonDecomposableClassificationLoss<StatisticType>> createNonDecomposableClassificationLoss() const = 0

Creates and returns a new object of type INonDecomposableClassificationLoss.

Returns:

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

inline virtual std::unique_ptr<IDecomposableClassificationLoss<StatisticType>> createDecomposableClassificationLoss() const final override

Creates and returns a new object of type IDecomposableClassificationLoss.

Returns:

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

template<typename StatisticType>
class INonDecomposableRegressionLossFactory : public boosting::IDecomposableRegressionLossFactory<StatisticType>
#include <loss_non_decomposable.hpp>

Defines an interface for all factories that allow to create instances of the type INonDecomposableRegressionLoss.

Template Parameters:

StatisticType – The type of the gradients and Hessians that are calculated by the loss function

Public Functions

inline virtual ~INonDecomposableRegressionLossFactory() override
virtual std::unique_ptr<INonDecomposableRegressionLoss<StatisticType>> createNonDecomposableRegressionLoss() const = 0

Creates and returns a new object of type INonDecomposableRegressionLoss.

Returns:

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

inline virtual std::unique_ptr<IDecomposableRegressionLoss<StatisticType>> createDecomposableRegressionLoss() const final override

Creates and returns a new object of type IDecomposableRegressionLoss.

Returns:

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

class INonDecomposableLossConfig : public virtual boosting::ILossConfig
#include <loss_non_decomposable.hpp>

Defines an interface for all classes that allow to configure a non-decomposable loss function.

Subclassed by boosting::INonDecomposableClassificationLossConfig, boosting::INonDecomposableRegressionLossConfig

Public Functions

inline virtual ~INonDecomposableLossConfig() override
inline virtual bool isDecomposable() const final override

Returns whether the loss function is decomposable or not.

Returns:

True, if the loss function is decomposable, false otherwise

inline virtual bool isSparse() const override

Returns whether the loss function supports to use a sparse format for storing statistics or not.

Returns:

True, if the loss function supports to use a sparse format for storing statistics, false otherwise

class INonDecomposableClassificationLossConfig : public virtual boosting::IClassificationLossConfig, public virtual boosting::INonDecomposableLossConfig
#include <loss_non_decomposable.hpp>

Defines an interface for all classes that allow to configure a non-decomposable loss function that can be used in classification problems.

Subclassed by boosting::NonDecomposableLogisticLossConfig, boosting::NonDecomposableSquaredErrorLossConfig, boosting::NonDecomposableSquaredHingeLossConfig

Public Functions

inline virtual ~INonDecomposableClassificationLossConfig() override
virtual std::unique_ptr<IPreset<float32>> createNonDecomposable32BitClassificationPreset() const = 0

Creates and returns a new object of type IPreset<float32>.

Returns:

An unique pointer to an object of type IPreset<float32> that has been created

virtual std::unique_ptr<IPreset<float64>> createNonDecomposable64BitClassificationPreset() const = 0

Creates and returns a new object of type IPreset<float64>.

Returns:

An unique pointer to an object of type IPreset<float64> that has been created

inline virtual std::unique_ptr<IClassificationLossConfig::IPreset<float32>> create32BitClassificationPreset() const final override

Creates and returns a new object of type IPreset<float32>.

Returns:

An unique pointer to an object of type IPreset<float32> that has been created

inline virtual std::unique_ptr<IClassificationLossConfig::IPreset<float64>> create64BitClassificationPreset() const final override

Creates and returns a new object of type IPreset<float64>.

Returns:

An unique pointer to an object of type IPreset<float64> that has been created

template<typename StatisticType>
class IPreset : public boosting::IClassificationLossConfig::IPreset<StatisticType>
#include <loss_non_decomposable.hpp>

Provides access to the interface of an INonDecomposableClassificationLossConfig, abstracting away certain configuration options that have already been pre-determined.

Template Parameters:

StatisticType – The type that should be used for representing statistics

Public Functions

inline virtual ~IPreset() override
virtual std::unique_ptr<INonDecomposableClassificationLossFactory<StatisticType>> createNonDecomposableClassificationLossFactory() const = 0

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

Returns:

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

inline virtual std::unique_ptr<IClassificationEvaluationMeasureFactory<StatisticType>> createClassificationEvaluationMeasureFactory() const final override

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

Returns:

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

inline virtual std::unique_ptr<IDistanceMeasureFactory<StatisticType>> createDistanceMeasureFactory() const final override

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

Returns:

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

class INonDecomposableRegressionLossConfig : public virtual boosting::IRegressionLossConfig, public virtual boosting::INonDecomposableLossConfig
#include <loss_non_decomposable.hpp>

Defines an interface for all classes that allow to configure a non-decomposable loss function that can be used in regression problems.

Subclassed by boosting::NonDecomposableSquaredErrorLossConfig

Public Functions

inline virtual ~INonDecomposableRegressionLossConfig() override
virtual std::unique_ptr<IPreset<float32>> createNonDecomposable32BitRegressionPreset() const = 0

Creates and returns a new object of type IPreset<float32>.

Returns:

An unique pointer to an object of type IPreset<float32> that has been created

virtual std::unique_ptr<IPreset<float64>> createNonDecomposable64BitRegressionPreset() const = 0

Creates and returns a new object of type IPreset<float64>.

Returns:

An unique pointer to an object of type IPreset<float64> that has been created

inline virtual std::unique_ptr<IRegressionLossConfig::IPreset<float32>> create32BitRegressionPreset() const final override

Creates and returns a new object of type IPreset<float32>.

Returns:

An unique pointer to an object of type IPreset<float32> that has been created

inline virtual std::unique_ptr<IRegressionLossConfig::IPreset<float64>> create64BitRegressionPreset() const final override

Creates and returns a new object of type IPreset<float64>.

Returns:

An unique pointer to an object of type IPreset<float64> that has been created

template<typename StatisticType>
class IPreset : public boosting::IRegressionLossConfig::IPreset<StatisticType>
#include <loss_non_decomposable.hpp>

Provides access to the interface of an INonDecomposableRegressionLossConfig, abstracting away certain configuration options that have already been pre-determined.

Template Parameters:

StatisticType – The type that should be used for representing statistics

Public Functions

inline virtual ~IPreset() override
virtual std::unique_ptr<INonDecomposableRegressionLossFactory<StatisticType>> createNonDecomposableRegressionLossFactory() const = 0

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

Returns:

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

inline virtual std::unique_ptr<IRegressionEvaluationMeasureFactory<StatisticType>> createRegressionEvaluationMeasureFactory() const final override

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

Returns:

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