File label_vector_set.hpp¶
Functions
-
std::unique_ptr<ILabelVectorSet> createLabelVectorSet()¶
Creates and returns a new object of the type
ILabelVectorSet.- Returns:
An unique pointer to an object of type
ILabelVectorSetthat has been created
-
class ILabelVectorSet : public IOutputSpaceInfo¶
- #include <label_vector_set.hpp>
Defines an interface for all classes that provide access to a set of unique label vectors.
Subclassed by LabelVectorSet
Public Types
-
using LabelVectorVisitor = std::function<void(const LabelVector&, uint32)>¶
A visitor function for handling objects of the type
LabelVectorand their frequencies.
Public Functions
-
inline virtual ~ILabelVectorSet() override¶
-
virtual void addLabelVector(std::unique_ptr<LabelVector> labelVectorPtr, uint32 frequency) = 0¶
Adds a label vector to the set.
- Parameters:
labelVectorPtr – An unique pointer to an object of type
LabelVectorfrequency – The frequency of the label vector
-
virtual void visit(LabelVectorVisitor visitor) const = 0¶
Invokes the given visitor function for each label vector that has been added to the set.
- Parameters:
visitor – The visitor function for handling objects of the type
LabelVector
-
using LabelVectorVisitor = std::function<void(const LabelVector&, uint32)>¶
-
class LabelVectorSet : public ILabelVectorSet¶
- #include <label_vector_set.hpp>
An implementation of the type
ILabelVectorSetthat stores a set of unique label vectors, as well as their frequency.Public Types
-
using const_iterator = std::vector<std::unique_ptr<LabelVector>>::const_iterator¶
An iterator that provides read-only access to the label vectors.
Public Functions
-
LabelVectorSet()¶
-
LabelVectorSet(const IRowWiseLabelMatrix &labelMatrix)¶
- Parameters:
labelMatrix – A reference to an object of type
IRowWiseLabelMatrixthat stores the label vectors that should be added to the set
-
const_iterator cbegin() const¶
Returns a
const_iteratorto the beginning of the label vectors in the set.- Returns:
A
const_iteratorto the beginning
-
const_iterator cend() const¶
Returns a
const_iteratorto the end of the label vectors in the set.- Returns:
A
const_iteratorto the end
-
frequency_const_iterator frequencies_cbegin() const¶
Returns a
frequency_const_iteratorto the beginning of the frequencies.- Returns:
frequency_const_iterator A
frequency_const_iteratorto the beginning
-
frequency_const_iterator frequencies_cend() const¶
Returns a
frequency_const_iteratorto the end of the frequencies.- Returns:
frequency_const_iterator A
frequency_const_iteratorto the end
-
uint32 getNumLabelVectors() const¶
Returns the number of label vectors in the set.
- Returns:
The number of label vectors
-
virtual void addLabelVector(std::unique_ptr<LabelVector> labelVectorPtr, uint32 frequency) override¶
Adds a label vector to the set.
- Parameters:
labelVectorPtr – An unique pointer to an object of type
LabelVectorfrequency – The frequency of the label vector
-
virtual void visit(LabelVectorVisitor visitor) const override¶
Invokes the given visitor function for each label vector that has been added to the set.
- Parameters:
visitor – The visitor function for handling objects of the type
LabelVector
-
virtual std::unique_ptr<IJointProbabilityCalibrator> createJointProbabilityCalibrator(const IJointProbabilityCalibratorFactory &factory, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel) const override¶
Creates and returns a new instance of the class
IJointProbabilityCalibrator, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IJointProbabilityCalibratorFactorythat should be used to create the instancemarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilities
- Returns:
An unique pointer to an object of type
IJointProbabilityCalibratorthat has been created
-
virtual std::unique_ptr<IBinaryPredictor> createBinaryPredictor(const IBinaryPredictorFactory &factory, const CContiguousView<const float32> &featureMatrix, const RuleList &ruleList, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const override¶
Creates and returns a new instance of the class
IBinaryPredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IBinaryPredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CContiguousViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsmarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat may be used for the calibration of joint probabilitiesnumLabels – The number of labels to predict for
- Returns:
An unique pointer to an object of type
IBinaryPredictorthat has been created
-
virtual std::unique_ptr<IBinaryPredictor> createBinaryPredictor(const IBinaryPredictorFactory &factory, const CsrView<const float32> &featureMatrix, const RuleList &ruleList, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const override¶
Creates and returns a new instance of the class
IBinaryPredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IBinaryPredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CsrViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsmarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat may be used for the calibration of joint probabilitiesnumLabels – The number of labels to predict for
- Returns:
An unique pointer to an object of type
IBinaryPredictorthat has been created
-
virtual std::unique_ptr<ISparseBinaryPredictor> createSparseBinaryPredictor(const ISparseBinaryPredictorFactory &factory, const CContiguousView<const float32> &featureMatrix, const RuleList &ruleList, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const override¶
Creates and returns a new instance of the class
ISparseBinaryPredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
ISparseBinaryPredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CContiguousViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsmarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat may be used for the calibration of joint probabilitiesnumLabels – The number of labels to predict for
- Returns:
An unique pointer to an object of type
ISparseBinaryPredictorthat has been created
-
virtual std::unique_ptr<ISparseBinaryPredictor> createSparseBinaryPredictor(const ISparseBinaryPredictorFactory &factory, const CsrView<const float32> &featureMatrix, const RuleList &ruleList, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const override¶
Creates and returns a new instance of the class
ISparseBinaryPredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
ISparseBinaryPredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CsrViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsmarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat may be used for the calibration of joint probabilitiesnumLabels – The number of labels to predict for
- Returns:
An unique pointer to an object of type
ISparseBinaryPredictorthat has been created
-
virtual std::unique_ptr<IScorePredictor> createScorePredictor(const IScorePredictorFactory &factory, const CContiguousView<const float32> &featureMatrix, const RuleList &ruleList, uint32 numOutputs) const override¶
Creates and returns a new instance of the class
IScorePredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IScorePredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CContiguousViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsnumOutputs – The number of outputs to predict for
- Returns:
An unique pointer to an object of type
IScorePredictorthat has been created
-
virtual std::unique_ptr<IScorePredictor> createScorePredictor(const IScorePredictorFactory &factory, const CsrView<const float32> &featureMatrix, const RuleList &ruleList, uint32 numOutputs) const override¶
Creates and returns a new instance of the class
IScorePredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IScorePredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CsrViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsnumOutputs – The number of outputs to predict for
- Returns:
An unique pointer to an object of type
IScorePredictorthat has been created
-
virtual std::unique_ptr<IProbabilityPredictor> createProbabilityPredictor(const IProbabilityPredictorFactory &factory, const CContiguousView<const float32> &featureMatrix, const RuleList &ruleList, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const override¶
Creates and returns a new instance of the class
IProbabilityPredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IProbabilityPredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CContiguousViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsmarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat may be used for the calibration of joint probabilitiesnumLabels – The number of labels to predict for
- Returns:
An unique pointer to an object of type
IProbabilityPredictorthat has been created
-
virtual std::unique_ptr<IProbabilityPredictor> createProbabilityPredictor(const IProbabilityPredictorFactory &factory, const CsrView<const float32> &featureMatrix, const RuleList &ruleList, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const override¶
Creates and returns a new instance of the class
IProbabilityPredictor, based on the type of this information about the output space.- Parameters:
factory – A reference to an object of type
IProbabilityPredictorFactorythat should be used to create the instancefeatureMatrix – A reference to an object of type
CsrViewthat provides row-wise access to the features of the query examplesmodel – A reference to an object of type
RuleListthat should be used to obtain predictionsmarginalProbabilityCalibrationModel – A reference to an object of type
IMarginalProbabilityCalibrationModelthat may be used for the calibration of marginal probabilitiesjointProbabilityCalibrationModel – A reference to an object of type
IJointProbabilityCalibrationModelthat may be used for the calibration of joint probabilitiesnumLabels – The number of labels to predict for
- Returns:
An unique pointer to an object of type
IProbabilityPredictorthat has been created
Private Members
-
std::vector<std::unique_ptr<LabelVector>> labelVectors_¶
-
using const_iterator = std::vector<std::unique_ptr<LabelVector>>::const_iterator¶