File measure_distance.hpp¶
-
template<typename ScoreType>
class IDistanceMeasure¶ - #include <measure_distance.hpp>
Defines an interface for all measures that may be used to compare scores that are predicted for individual examples to the corresponding ground truth labels in order to obtain a distance.
- Template Parameters:
ScoreType – The type of the predicted scores
Public Functions
-
inline virtual ~IDistanceMeasure()¶
-
virtual ScoreType measureDistance(uint32 labelVectorIndex, const LabelVector &labelVector, typename View<ScoreType>::const_iterator scoresBegin, typename View<ScoreType>::const_iterator scoresEnd) const = 0¶
Calculates and returns the distance between the predicted scores for a single example and a label vector.
- Parameters:
labelVectorIndex – The index of the label vector, the scores should be compared to
labelVector – A reference to an object of type
LabelVector, the scores should be compared toscoresBegin – An iterator to the beginning of the predicted scores
scoresEnd – An iterator to the end of the predicted scores
- Returns:
The distance that has been calculated
-
inline virtual const LabelVector &getClosestLabelVector(const LabelVectorSet &labelVectorSet, typename View<ScoreType>::const_iterator scoresBegin, typename View<ScoreType>::const_iterator scoresEnd) const¶
Searches among the label vectors contained in a
LabelVectorSetand returns the one that is closest to the scores that are predicted for an example.- Parameters:
labelVectorSet – A reference to an object of type
LabelVectorSetthat contains the label vectorsscoresBegin – An iterator to the beginning of the predicted scores
scoresEnd – An iterator to the end of the predicted scores
- Returns:
A reference to an object of type
LabelVectorthat has been found
-
template<typename ScoreType>
class IDistanceMeasureFactory¶ - #include <measure_distance.hpp>
Defines an interface for all factories that allow to create instances of the type
IDistanceMeasure.- Template Parameters:
ScoreType – The type of the predicted scores
Public Functions
-
inline virtual ~IDistanceMeasureFactory()¶
-
virtual std::unique_ptr<IDistanceMeasure<ScoreType>> createDistanceMeasure(const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel) const = 0¶
Creates and returns a new object of type
IDistanceMeasure.- Parameters:
marginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat should be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat should be used for the calibration of joint probabilities
- Returns:
An unique pointer to an object of type
IDistanceMeasurethat has been created