File statistics.hpp

class IStatistics : public IStatisticsSpace
#include <statistics.hpp>

Defines an interface for all classes that provide access to statistics about the quality of predictions for training examples, which serve as the basis for learning a new rule or refining an existing one.

Subclassed by AbstractStatistics< State >

Public Functions

inline virtual ~IStatistics() override
virtual float64 evaluatePrediction(uint32 statisticIndex) const = 0

Calculates and returns a numerical score that assesses the quality of the current predictions for a specific statistic.

Parameters:

statisticIndex – The index of the statistic for which the predictions should be evaluated

Returns:

The numerical score that has been calculated

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const EqualWeightVector &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const EqualWeightVector &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const BitWeightVector &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type BitWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const BitWeightVector &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type BitWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const DenseWeightVector<uint16> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type DenseWeightVector<uint16> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const DenseWeightVector<uint16> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type DenseWeightVector<uint16> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const DenseWeightVector<float32> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const DenseWeightVector<float32> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const OutOfSampleWeightVector<EqualWeightVector> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<EqualWeightVector> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const OutOfSampleWeightVector<EqualWeightVector> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<EqualWeightVector> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const OutOfSampleWeightVector<BitWeightVector> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<BitWeightVector> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const OutOfSampleWeightVector<BitWeightVector> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<BitWeightVector> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const OutOfSampleWeightVector<DenseWeightVector<uint16>> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<DenseWeightVector<uint16>> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const OutOfSampleWeightVector<DenseWeightVector<uint16>> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<DenseWeightVector<uint16>> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const CompleteIndexVector &outputIndices, const OutOfSampleWeightVector<DenseWeightVector<float32>> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific CompleteIndexVector.

Parameters:
  • outputIndices – A reference to an object of type CompleteIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<DenseWeightVector<float32>> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IStatisticsSubset> createSubset(const PartialIndexVector &outputIndices, const OutOfSampleWeightVector<DenseWeightVector<float32>> &weights) const = 0

Creates and returns a new object of type IStatisticsSubset that includes only those outputs, whose indices are provided by a specific PartialIndexVector.

Parameters:
  • outputIndices – A reference to an object of type PartialIndexVector that provides access to the indices of the outputs that should be included in the subset

  • weights – A reference to an object of type OutOfSampleWeightVector<DenseWeightVector<float32>> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IWeightedStatistics> createWeightedStatistics(const EqualWeightVector &weights) const = 0

Creates and returns a new object of type IWeightedStatistics.

Parameters:

weights – A reference to an object of type EqualWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IWeightedStatistics> createWeightedStatistics(const BitWeightVector &weights) const = 0

Creates and returns a new object of type IWeightedStatistics.

Parameters:

weights – A reference to an object of type BitWeightVector that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IWeightedStatistics> createWeightedStatistics(const DenseWeightVector<uint16> &weights) const = 0

Creates and returns a new object of type IWeightedStatistics.

Parameters:

weights – A reference to an object of type DenseWeightVector<uint16> that provides access to the weights of individual training examples

Returns:

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

virtual std::unique_ptr<IWeightedStatistics> createWeightedStatistics(const DenseWeightVector<float32> &weights) const = 0

Creates and returns a new object of type IWeightedStatistics.

Parameters:

weights – A reference to an object of type DenseWeightVector<float32> that provides access to the weights of individual training examples

Returns:

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

template<typename State>
class AbstractStatistics : public virtual IStatistics
#include <statistics.hpp>

An abstract base class for all classes that provide access to statistics about the quality of predictions for training examples, which serve as the basis for learning a new rule or refining an existing one.

Template Parameters:

State – The type of the state of the training process

Public Functions

inline explicit AbstractStatistics(std::unique_ptr<State> statePtr)
Parameters:

statePtr – An unique pointer to an object of template type State that represents the state of the training process and allows to update it

inline virtual ~AbstractStatistics() override
inline virtual uint32 getNumStatistics() const final override

inline virtual uint32 getNumOutputs() const final override

Protected Attributes

const std::unique_ptr<State> statePtr_

An unique pointer to the state of the training process.