File loss_non_decomposable_squared_hinge.hpp

namespace boosting
class NonDecomposableSquaredHingeLossConfig : public boosting::INonDecomposableClassificationLossConfig
#include <loss_non_decomposable_squared_hinge.hpp>

Allows to configure a loss function that implements a multivariate variant of the squared hinge loss that is non-decomposable.

Public Functions

NonDecomposableSquaredHingeLossConfig(ReadableProperty<IStatisticTypeConfig> statisticTypeConfig)
Parameters:

statisticTypeConfig – A ReadableProperty that allows to access the IStatisticTypeConfig that stores the configuration of the data type that should be used for representing statistics about the quality of predictions for training examples

virtual std::unique_ptr<IClassificationStatisticsProviderFactory> createClassificationStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix, const BlasFactory &blasFactory, const LapackFactory &lapackFactory, bool preferSparseStatistics) const override

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

  • blasFactory – A reference to an object of type BlasFactory that allows to create objects for executing BLAS routines

  • lapackFactory – A reference to an object of type LapackFactory that allows to create objects for executing 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<IMarginalProbabilityFunctionFactory> createMarginalProbabilityFunctionFactory() const override

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 override

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

virtual float64 getDefaultPrediction() const override

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

Returns:

The default prediction

virtual std::unique_ptr<INonDecomposableClassificationLossConfig::IPreset<float32>> createNonDecomposable32BitClassificationPreset() const 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

virtual std::unique_ptr<INonDecomposableClassificationLossConfig::IPreset<float64>> createNonDecomposable64BitClassificationPreset() const 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

Private Members

const ReadableProperty<IStatisticTypeConfig> statisticTypeConfig_