File statistic_format.hpp

namespace boosting

Functions

static inline bool shouldSparseStatisticsBePreferred(const IRowWiseLabelMatrix &labelMatrix, bool defaultRuleUsed, bool partialHeadsUsed)

Returns whether a sparse representation of the gradients and Hessians should be preferred or not.

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

  • defaultRuleUsed – True, if a default rule is used, false otherwise

  • partialHeadsUsed – True, if the partial heads are used by the rules, false otherwise

Returns:

True, if a sparse representation should be preferred, false otherwise

class IStatisticsConfig
#include <statistic_format.hpp>

Defines an interface for all classes that allow to configure which format should be used for storing statistics about the labels of the training examples.

Subclassed by boosting::AutomaticStatisticsConfig, boosting::DenseStatisticsConfig, boosting::SparseStatisticsConfig

Public Functions

inline virtual ~IStatisticsConfig()
virtual std::unique_ptr<IStatisticsProviderFactory> createStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix, const Blas &blas, const Lapack &lapack) const = 0

Creates and returns a new object of type IStatisticsProviderFactory 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 row-wise 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

Returns:

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

virtual bool isDense() const = 0

Returns whether a dense format is used for storing statistics about the labels of the training examples or not.

Returns:

True, if a dense format is used, false otherwise

virtual bool isSparse() const = 0

Returns whether a sparse format is used for storing statistics about the labels of the training examples or not.

Returns:

True, if a sparse format is used, false otherwise