File loss.hpp

namespace boosting
class IClassificationLoss : public IDistanceMeasure
#include <loss.hpp>

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

Subclassed by boosting::IDecomposableClassificationLoss, boosting::INonDecomposableClassificationLoss

Public Functions

inline virtual ~IClassificationLoss() override
class IRegressionLoss
#include <loss.hpp>

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

Subclassed by boosting::IDecomposableRegressionLoss, boosting::INonDecomposableRegressionLoss

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

virtual float64 getDefaultPrediction() const = 0

Returns the default prediction for an example that is not covered by any rules.

Returns:

The default prediction

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 Blas &blas, const Lapack &lapack, bool preferSparseStatistics) const = 0

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

Parameters:
  • featureMatrix – A reference to an object of type IFeatureMatrix that provides access to the feature values of the training examples

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

  • blas – A reference to an object of type Blas that allows to execute BLAS routines

  • lapack – A reference to an object of type Lapack that allows to execute LAPACK routines

  • preferSparseStatistics – True, if a sparse representation of statistics should be preferred, if possible, false otherwise

Returns:

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

virtual std::unique_ptr<IClassificationEvaluationMeasureFactory> createClassificationEvaluationMeasureFactory() const = 0

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

virtual std::unique_ptr<IDistanceMeasureFactory> createDistanceMeasureFactory() const = 0

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

virtual std::unique_ptr<IMarginalProbabilityFunctionFactory> createMarginalProbabilityFunctionFactory() const = 0

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

Returns:

An unique pointer to an object of type IMarginalProbabilityFunctionFactory that 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 IJointProbabilityFunctionFactory according to the specified configuration.

Returns:

An unique pointer to an object of type IJointProbabilityFunctionFactory that has been created to a null pointer, if the loss function does not support the prediction of joint probabilities

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 &regressionMatrix, const Blas &blas, const Lapack &lapack, bool preferSparseStatistics) const = 0

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

Parameters:
  • featureMatrix – A reference to an object of type IFeatureMatrix that provides access to the feature values of the training examples

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

  • blas – A reference to an object of type Blas that allows to execute BLAS routines

  • lapack – A reference to an object of type Lapack that allows to execute LAPACK routines

  • preferSparseStatistics – True, if a sparse representation of statistics should be preferred, if possible, false otherwise

Returns:

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

virtual std::unique_ptr<IRegressionEvaluationMeasureFactory> createRegressionEvaluationMeasureFactory() const = 0

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