File loss.hpp¶
-
namespace boosting
-
template<typename StatisticType>
class ILoss¶ - #include <loss.hpp>
Defines an interface for all loss functions.
- Template Parameters:
StatisticType – The type of the gradients and Hessians that are calculated by the loss function
Subclassed by boosting::IClassificationLoss< StatisticType >, boosting::IRegressionLoss< StatisticType >
Public Types
-
using statistic_type = StatisticType¶
The type of the gradients and Hessians that are calculated by the loss function.
Public Functions
-
inline virtual ~ILoss()¶
-
template<typename StatisticType>
class IClassificationLoss : public boosting::ILoss<StatisticType>, public IDistanceMeasure<StatisticType>¶ - #include <loss.hpp>
Defines an interface for all 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::IDecomposableClassificationLoss< StatisticType >, boosting::INonDecomposableClassificationLoss< StatisticType >
Public Functions
-
inline virtual ~IClassificationLoss() override¶
-
template<typename StatisticType>
class IRegressionLoss : public boosting::ILoss<StatisticType>¶ - #include <loss.hpp>
Defines an interface for all loss functions that can be used in regression problems.
- Template Parameters:
StatisticType – The type of the gradients and Hessians that are are calculated by the loss function
Subclassed by boosting::IDecomposableRegressionLoss< StatisticType >, boosting::INonDecomposableRegressionLoss< StatisticType >
Public Functions
-
inline virtual ~IRegressionLoss()¶
-
class ILossConfig¶
- #include <loss.hpp>
Defines an interface for all classes that allow to configure a loss function.
Subclassed by boosting::IClassificationLossConfig, boosting::IDecomposableLossConfig, boosting::INonDecomposableLossConfig, boosting::IRegressionLossConfig
Public Functions
-
inline virtual ~ILossConfig()¶
-
virtual bool isDecomposable() const = 0¶
Returns whether the loss function is decomposable or not.
- Returns:
True, if the loss function is decomposable, false otherwise
-
virtual bool isSparse() const = 0¶
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 ~ILossConfig()¶
-
class IClassificationLossConfig : public virtual boosting::ILossConfig¶
- #include <loss.hpp>
Defines an interface for all classes that allow to configure a loss function that can be used in classification problems.
Subclassed by boosting::IDecomposableClassificationLossConfig, boosting::INonDecomposableClassificationLossConfig
Public Functions
-
inline virtual ~IClassificationLossConfig() override¶
-
virtual std::unique_ptr<IClassificationStatisticsProviderFactory> createClassificationStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix, const BlasFactory &blasFactory, const LapackFactory &lapackFactory, bool preferSparseStatistics) const = 0¶
Creates and returns a new object of type
IClassificationStatisticsProviderFactoryaccording to the specified configuration.- Parameters:
featureMatrix – A reference to an object of type
IFeatureMatrixthat provides access to the feature values of the training exampleslabelMatrix – A reference to an object of type
IRowWiseLabelMatrixthat provides access to the labels of the training examplesblasFactory – A reference to an object of type
BlasFactorythat allows to create objects for executing BLAS routineslapackFactory – A reference to an object of type
LapackFactorythat allows to create objects for executing LAPACK routinespreferSparseStatistics – True, if a sparse representation of statistics should be preferred, if possible, false otherwise
- Returns:
An unique pointer to an object of type
IClassificationStatisticsProviderFactorythat has been created
-
virtual std::unique_ptr<IMarginalProbabilityFunctionFactory> createMarginalProbabilityFunctionFactory() const = 0¶
Creates and returns a new object of type
IMarginalProbabilityFunctionFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IMarginalProbabilityFunctionFactorythat has been created or a null pointer, if the loss function does not support the prediction of marginal probabilities
-
virtual std::unique_ptr<IJointProbabilityFunctionFactory> createJointProbabilityFunctionFactory() const = 0¶
Creates and returns a new object of type
IJointProbabilityFunctionFactoryaccording to the specified configuration.- Returns:
An unique pointer to an object of type
IJointProbabilityFunctionFactorythat has been created to a null pointer, if the loss function does not support the prediction of joint probabilities
-
template<typename StatisticType>
class IPreset¶ - #include <loss.hpp>
Provides access to the interface of an
IClassificationLossConfig, 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::IDecomposableClassificationLossConfig::IPreset< StatisticType >, boosting::INonDecomposableClassificationLossConfig::IPreset< StatisticType >
Public Functions
-
inline virtual ~IPreset()¶
-
virtual std::unique_ptr<IClassificationEvaluationMeasureFactory<StatisticType>> createClassificationEvaluationMeasureFactory() const = 0¶
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
-
virtual std::unique_ptr<IDistanceMeasureFactory<StatisticType>> createDistanceMeasureFactory() const = 0¶
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 ~IClassificationLossConfig() override¶
-
class IRegressionLossConfig : public virtual boosting::ILossConfig¶
- #include <loss.hpp>
Defines an interface for all classes that allow to configure a loss function that can be used in regression problems.
Subclassed by boosting::IDecomposableRegressionLossConfig, boosting::INonDecomposableRegressionLossConfig
Public Functions
-
inline virtual ~IRegressionLossConfig() override¶
-
virtual std::unique_ptr<IRegressionStatisticsProviderFactory> createRegressionStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseRegressionMatrix ®ressionMatrix, const BlasFactory &blasFactory, const LapackFactory &lapackFactory, bool preferSparseStatistics) const = 0¶
Creates and returns a new object of type
IRegressionStatisticsProviderFactoryaccording to the specified configuration.- Parameters:
featureMatrix – A reference to an object of type
IFeatureMatrixthat provides access to the feature values of the training examplesregressionMatrix – A reference to an object of type
IRowWiseRegressionMatrixthat provides access to the regression scores of the training examplesblasFactory – A reference to an object of type
BlasFactorythat allows to create objects for executing BLAS routineslapackFactory – A reference to an object of type
LapackFactorythat allows to create objects for executing LAPACK routinespreferSparseStatistics – True, if a sparse representation of statistics should be preferred, if possible, false otherwise
- Returns:
An unique pointer to an object of type
IRegressionStatisticsProviderFactorythat has been created
-
template<typename StatisticType>
class IPreset¶ - #include <loss.hpp>
Provides access to the interface of an
IRegressionLossConfig, 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::IDecomposableRegressionLossConfig::IPreset< StatisticType >, boosting::INonDecomposableRegressionLossConfig::IPreset< StatisticType >
Public Functions
-
inline virtual ~IPreset()¶
-
virtual std::unique_ptr<IRegressionEvaluationMeasureFactory<StatisticType>> createRegressionEvaluationMeasureFactory() const = 0¶
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 ~IRegressionLossConfig() override¶
-
template<typename StatisticType>