File statistics_state.hpp

template<typename ScoreType>
class IStatisticsState
#include <statistics_state.hpp>

Defines an interface for all classes that allow to update statistics during the training process.

Template Parameters:

ScoreType – The type of the scores that are used for updating statistics

Public Types

using score_type = ScoreType

The type of the scores that are used for updating statistics.

Public Functions

inline virtual ~IStatisticsState()
virtual void update(uint32 statisticIndex, typename View<ScoreType>::const_iterator scoresBegin, typename View<ScoreType>::const_iterator scoresEnd, CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd) = 0

Adds given scores to the predictions for all available outputs and updates affected statistics at a specific index.

Parameters:
  • statisticIndex – The index of the statistics to be updated

  • scoresBegin – An iterator to the beginning of the scores to be added

  • scoresEnd – An iterator to the end of the scores to be added

  • indicesBegin – An iterator to the beginning of the output indices

  • indicesEnd – An iterator to the end of the output indices

virtual void update(uint32 statisticIndex, typename View<ScoreType>::const_iterator scoresBegin, typename View<ScoreType>::const_iterator scoresEnd, PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd) = 0

Adds given scores to the predictions for a subset of the available outputs and updates affected statistics at a specific index.

Parameters:
  • statisticIndex – The index of the statistics to be updated

  • scoresBegin – An iterator to the beginning of the scores to be added

  • scoresEnd – An iterator to the end of the scores to be added

  • indicesBegin – An iterator to the beginning of the output indices

  • indicesEnd – An iterator to the end of the output indices

virtual void revert(uint32 statisticIndex, typename View<ScoreType>::const_iterator scoresBegin, typename View<ScoreType>::const_iterator scoresEnd, CompleteIndexVector::const_iterator indicesBegin, CompleteIndexVector::const_iterator indicesEnd) = 0

Removes given scores from the predictions for all available outputs and updates affected statistics at a specific index.

Parameters:
  • statisticIndex – The index of the statistics to be updated

  • scoresBegin – An iterator to the beginning of the scores to be removed

  • scoresEnd – An iterator to the end of the scores to be removed

  • indicesBegin – An iterator to the beginning of the output indices

  • indicesEnd – An iterator to the end of the output indices

virtual void revert(uint32 statisticIndex, typename View<ScoreType>::const_iterator scoresBegin, typename View<ScoreType>::const_iterator scoresEnd, PartialIndexVector::const_iterator indicesBegin, PartialIndexVector::const_iterator indicesEnd) = 0

Removes given scores from the predictions for a subset of the available outputs and updates affected statistics at a specific index.

Parameters:
  • statisticIndex – The index of the statistics to be updated

  • scoresBegin – An iterator to the beginning of the scores to be removed

  • scoresEnd – An iterator to the end of the scores to be removed

  • indicesBegin – An iterator to the beginning of the output indices

  • indicesEnd – An iterator to the end of the output indices

virtual std::unique_ptr<IStatisticsUpdateCandidate> createUpdateCandidate(const IScoreVector &scoreVector) = 0

Creates and returns a new object of type IStatisticsUpdateCandidate that can be used to update this state.

Parameters:

scoreVector – A reference to an object of type IScoreVector that should be used for updating

Returns:

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