File transformation_binary_gfm.hpp

namespace boosting
class GfmBinaryTransformation : public boosting::IBinaryTransformation
#include <transformation_binary_gfm.hpp>

An implementation of the class IBinaryTransformation that transforms regression scores into binary predictions according to the general F-measure maximizer (GFM).

Public Functions

GfmBinaryTransformation(const LabelVectorSet &labelVectorSet, std::unique_ptr<IJointProbabilityFunction> jointProbabilityFunctionPtr)
Parameters:
  • labelVectorSet – A reference to an object of type LabelVectorSet that stores all known label vectors

  • jointProbabilityFunctionPtr – An unique pointer to an object of type JointProbabilityFunction that should be used to transform regression scores that are predicted for an example into a joint probability

virtual void apply(View<float64>::const_iterator scoresBegin, View<float64>::const_iterator scoresEnd, View<uint8>::iterator predictionBegin, View<uint8>::iterator predictionEnd) const override

Transforms regression scores into binary predictions.

Parameters:
  • scoresBegin – An iterator to the beginning of the regression scores

  • scoresEnd – An iterator to the end of the regression scores

  • predictionBegin – An iterator to the beginning of the binary predictions

  • predictionEnd – An iterator to the end of the binary predictions

virtual void apply(View<float64>::const_iterator scoresBegin, View<float64>::const_iterator scoresEnd, BinaryLilMatrix::row predictionRow) const override

Transforms regression scores into sparse binary predictions.

Parameters:
  • scoresBegin – An iterator to the beginning of the regression scores

  • scoresEnd – An iterator to the end of the regression scores

  • predictionRow – An object of type BinaryLilMatrix::row that should be used to store the binary predictions

Private Members

const LabelVectorSet &labelVectorSet_
const uint32 maxLabelCardinality_
const std::unique_ptr<IJointProbabilityFunction> jointProbabilityFunctionPtr_