File measure_distance.hpp¶
-
class IDistanceMeasure¶
- #include <measure_distance.hpp>
Defines an interface for all measures that may be used to compare predictions for individual examples to the corresponding ground truth labels in order to obtain a distance.
Public Functions
-
inline virtual ~IDistanceMeasure()¶
-
virtual float64 measureDistance(uint32 labelVectorIndex, const LabelVector &labelVector, View<float64>::const_iterator scoresBegin, View<float64>::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, View<float64>::const_iterator scoresBegin, View<float64>::const_iterator scoresEnd) const¶
Searches among the label vectors contained in a
LabelVectorSet
and returns the one that is closest to the scores that are predicted for an example.- Parameters:
labelVectorSet – A reference to an object of type
LabelVectorSet
that 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
LabelVector
that has been found
-
inline virtual ~IDistanceMeasure()¶
-
class IDistanceMeasureFactory¶
- #include <measure_distance.hpp>
Defines an interface for all factories that allow to create instances of the type
IDistanceMeasure
.Public Functions
-
inline virtual ~IDistanceMeasureFactory()¶
-
virtual std::unique_ptr<IDistanceMeasure> 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
IMarginalProbabilityCalibrationModel
that should be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModel
that should be used for the calibration of joint probabilities
- Returns:
An unique pointer to an object of type
IDistanceMeasure
that has been created
-
inline virtual ~IDistanceMeasureFactory()¶