File loss_decomposable.hpp¶
-
namespace boosting
-
template<typename StatisticType>
class IDecomposableClassificationLoss : public virtual boosting::IClassificationLoss<StatisticType>, public virtual IClassificationEvaluationMeasure<StatisticType>¶ - #include <loss_decomposable.hpp>
Defines an interface for all 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
Subclassed by boosting::INonDecomposableClassificationLoss< StatisticType >, boosting::ISparseDecomposableClassificationLoss< StatisticType >
Public Functions
-
inline virtual ~IDecomposableClassificationLoss() override¶
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const CContiguousView<const uint8> &labelMatrix, const CContiguousView<StatisticType> &scoreMatrix, CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the labels, whose indices are provided by a
CompleteIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
labelMatrix – A reference to an object of type
CContiguousViewthat provides random access to the labels of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
CompleteIndexVector::const_iteratorto the beginning of the label indicesindicesEnd – A
CompleteIndexVector::const_iteratorto the end of the label indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const CContiguousView<const uint8> &labelMatrix, const CContiguousView<StatisticType> &scoreMatrix, PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the labels, whose indices are provided by a
PartialIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
labelMatrix – A reference to an object of type
CContiguousViewthat provides random access to the labels of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
PartialIndexVector::const_iteratorto the beginning of the label indicesindicesEnd – A
PartialIndexVector::const_iteratorto the end of the label indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const BinaryCsrView &labelMatrix, const CContiguousView<StatisticType> &scoreMatrix, CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the labels, whose indices are provided by a
CompleteIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
labelMatrix – A reference to an object of type
BinaryCsrViewthat provides row-wise access to the labels of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
CompleteIndexVector::const_iteratorto the beginning of the label indicesindicesEnd – A
CompleteIndexVector::const_iteratorto the end of the label indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const BinaryCsrView &labelMatrix, const CContiguousView<StatisticType> &scoreMatrix, PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the labels, whose indices are provided by a
PartialIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
labelMatrix – A reference to an object of template type
BinaryCsrViewthat provides row-wise access to the ground truth of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
PartialIndexVector::const_iteratorto the beginning of the label indicesindicesEnd – A
PartialIndexVector::const_iteratorto the end of the label indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
template<typename StatisticType>
class IDecomposableRegressionLoss : public virtual boosting::IRegressionLoss<StatisticType>, public virtual IRegressionEvaluationMeasure<StatisticType>¶ - #include <loss_decomposable.hpp>
Defines an interface for all 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
Subclassed by boosting::INonDecomposableRegressionLoss< StatisticType >
Public Functions
-
inline virtual ~IDecomposableRegressionLoss() override¶
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const CContiguousView<const float32> ®ressionMatrix, const CContiguousView<StatisticType> &scoreMatrix, CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the outputs, whose indices are provided by a
CompleteIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
regressionMatrix – A reference to an object of template type
CContiguousViewthat provides random access to the regression scores of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
CompleteIndexVector::const_iteratorto the beginning of the output indicesindicesEnd – A
CompleteIndexVector::const_iteratorto the end of the output indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const CContiguousView<const float32> ®ressionMatrix, const CContiguousView<StatisticType> &scoreMatrix, PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the outputs, whose indices are provided by a
PartialIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
regressionMatrix – A reference to an object of template type
CContiguousViewthat provides random access to the regression scores of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
PartialIndexVector::const_iteratorto the beginning of the output indicesindicesEnd – A
PartialIndexVector::const_iteratorto the end of the output indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const CsrView<const float32> ®ressionMatrix, const CContiguousView<StatisticType> &scoreMatrix, CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the outputs, whose indices are provided by a
CompleteIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
regressionMatrix – A reference to an object of type
CsrViewthat provides row-wise access to the regression scores of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
CompleteIndexVector::const_iteratorto the beginning of the output indicesindicesEnd – A
CompleteIndexVector::const_iteratorto the end of the output indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
virtual void updateDecomposableStatistics(uint32 exampleIndex, const CsrView<const float32> ®ressionMatrix, const CContiguousView<StatisticType> &scoreMatrix, PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd, CContiguousView<Statistic<StatisticType>> &statisticView) const = 0¶
Updates the statistics of the example at a specific index, considering only the outputs, whose indices are provided by a
PartialIndexVector.- Parameters:
exampleIndex – The index of the example for which the gradients and Hessians should be updated
regressionMatrix – A reference to an object of type
CsrViewthat provides row-wise access to the regression scores of the training examplesscoreMatrix – A reference to an object of type
CContiguousViewthat stores the currently predicted scoresindicesBegin – A
PartialIndexVector::const_iteratorto the beginning of the output indicesindicesEnd – A
PartialIndexVector::const_iteratorto the end of the output indicesstatisticView – A reference to an object of type
CContiguousViewto be updated
-
template<typename StatisticType>
class IDecomposableClassificationLossFactory : public virtual IClassificationEvaluationMeasureFactory<StatisticType>, public virtual IDistanceMeasureFactory<StatisticType>¶ - #include <loss_decomposable.hpp>
Defines an interface for all factories that allow to create instances of the type
IDecomposableClassificationLoss.- Template Parameters:
StatisticType – The type of the gradients and Hessians that are calculated by the loss function
Subclassed by boosting::INonDecomposableClassificationLossFactory< StatisticType >, boosting::ISparseDecomposableClassificationLossFactory< StatisticType >
Public Functions
-
inline virtual ~IDecomposableClassificationLossFactory() override¶
-
virtual std::unique_ptr<IDecomposableClassificationLoss<StatisticType>> createDecomposableClassificationLoss() const = 0¶
Creates and returns a new object of type
IDecomposableClassificationLoss.- Returns:
An unique pointer to an object of type
IDecomposableClassificationLossthat has been created
-
template<typename StatisticType>
class IDecomposableRegressionLossFactory : public IRegressionEvaluationMeasureFactory<StatisticType>¶ - #include <loss_decomposable.hpp>
Defines an interface for all factories that allow to create instances of the type
IDecomposableClassificationLoss.- Template Parameters:
StatisticType – The type of the gradients and Hessians that are calculated by the loss function
Subclassed by boosting::INonDecomposableRegressionLossFactory< StatisticType >
Public Functions
-
inline virtual ~IDecomposableRegressionLossFactory() override¶
-
virtual std::unique_ptr<IDecomposableRegressionLoss<StatisticType>> createDecomposableRegressionLoss() const = 0¶
Creates and returns a new object of type
IDecomposableRegressionLoss.- Returns:
An unique pointer to an object of type
IDecomposableRegressionLossthat has been created
-
class IDecomposableLossConfig : public virtual boosting::ILossConfig¶
- #include <loss_decomposable.hpp>
Defines an interface for all classes that allow to configure a decomposable loss function.
Subclassed by boosting::IDecomposableClassificationLossConfig, boosting::IDecomposableRegressionLossConfig
Public Functions
-
inline virtual ~IDecomposableLossConfig() 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
-
inline virtual ~IDecomposableLossConfig() override¶
-
class IDecomposableClassificationLossConfig : public virtual boosting::IDecomposableLossConfig, public virtual boosting::IClassificationLossConfig¶
- #include <loss_decomposable.hpp>
Defines an interface for all classes that allow to configure a decomposable loss function that can be used in classification problems.
Subclassed by boosting::DecomposableLogisticLossConfig, boosting::DecomposableSquaredErrorLossConfig, boosting::ISparseDecomposableClassificationLossConfig
Public Functions
-
inline virtual ~IDecomposableClassificationLossConfig() override¶
-
virtual std::unique_ptr<IPreset<float32>> createDecomposable32BitClassificationPreset() 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>> createDecomposable64BitClassificationPreset() 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
-
template<typename StatisticType>
class IPreset : public boosting::IClassificationLossConfig::IPreset<StatisticType>¶ - #include <loss_decomposable.hpp>
Provides access to the interface of an
IDecomposableClassificationLossConfig, abstracting away certain configuration options that have already been pre-determined.- Template Parameters:
StatisticType – The type that should be used for representing statistics
Subclassed by boosting::ISparseDecomposableClassificationLossConfig::IPreset< StatisticType >
Public Functions
-
inline virtual ~IPreset() override¶
-
virtual std::unique_ptr<IDecomposableClassificationLossFactory<StatisticType>> createDecomposableClassificationLossFactory() const = 0¶
Creates and returns a new object of type
IDecomposableClassificationLossFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IDecomposableClassificationLossFactorythat has been created
-
inline virtual std::unique_ptr<IClassificationEvaluationMeasureFactory<StatisticType>> createClassificationEvaluationMeasureFactory() const final override¶
Creates and returns a new object of type
IClassificationEvaluationMeasureFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IClassificationEvaluationMeasureFactorythat has been created
-
inline virtual std::unique_ptr<IDistanceMeasureFactory<StatisticType>> createDistanceMeasureFactory() const final override¶
Creates and returns a new object of type
IDistanceMeasureFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IDistanceMeasureFactorythat has been created
-
inline virtual ~IDecomposableClassificationLossConfig() override¶
-
class IDecomposableRegressionLossConfig : public virtual boosting::IDecomposableLossConfig, public virtual boosting::IRegressionLossConfig¶
- #include <loss_decomposable.hpp>
Defines an interface for all classes that allow to configure a decomposable loss function that can be used in regression problems.
Subclassed by boosting::DecomposableSquaredErrorLossConfig
Public Functions
-
inline virtual ~IDecomposableRegressionLossConfig() override¶
-
virtual std::unique_ptr<IPreset<float32>> createDecomposable32BitRegressionPreset() 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>> createDecomposable64BitRegressionPreset() 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
-
template<typename StatisticType>
class IPreset : public boosting::IRegressionLossConfig::IPreset<StatisticType>¶ - #include <loss_decomposable.hpp>
Provides access to the interface of an
IDecomposableRegressionLossConfig, 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<IDecomposableRegressionLossFactory<StatisticType>> createDecomposableRegressionLossFactory() const = 0¶
Creates and returns a new object of type
IDecomposableRegressionLossFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IDecomposableRegressionLossFactorythat has been created
-
inline virtual std::unique_ptr<IRegressionEvaluationMeasureFactory<StatisticType>> createRegressionEvaluationMeasureFactory() const final override¶
Creates and returns a new object of type
IRegressionEvaluationMeasureFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IRegressionEvaluationMeasureFactorythat has been created
-
inline virtual ~IDecomposableRegressionLossConfig() override¶
-
template<typename StatisticType>