File rule_model.hpp¶
-
class IRuleModel¶
- #include <rule_model.hpp>
Defines an interface for all rule-based models.
Subclassed by IRuleList
Public Functions
-
inline virtual ~IRuleModel()¶
-
virtual uint32 getNumRules() const = 0¶
Returns the total number of rules in the model, including the default rule, if available.
- Returns:
The number of rules
-
virtual uint32 getNumUsedRules() const = 0¶
Returns the number of used rules, including the default rule, if available.
- Returns:
The number of used rules
-
virtual void setNumUsedRules(uint32 numUsedRules) = 0¶
Sets the number of used rules, including the default rule, if available.
- Parameters:
numUsedRules – The number of used rules to be set or 0, if all rules should be used
-
virtual std::unique_ptr<IBinaryPredictor> createBinaryPredictor(const IBinaryPredictorFactory &factory, const CContiguousView<const float32> &featureMatrix, const IOutputSpaceInfo &outputSpaceInfo, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const = 0¶
Creates and returns a new instance of the class
IBinaryPredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const = 0¶
Creates and returns a new instance of the class
IBinaryPredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const = 0¶
Creates and returns a new instance of the class
ISparseBinaryPredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const = 0¶
Creates and returns a new instance of the class
ISparseBinaryPredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, uint32 numOutputs) const = 0¶
Creates and returns a new instance of the class
IScorePredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, uint32 numOutputs) const = 0¶
Creates and returns a new instance of the class
IScorePredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const = 0¶
Creates and returns a new instance of the class
IProbabilityPredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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 IOutputSpaceInfo &outputSpaceInfo, const IMarginalProbabilityCalibrationModel &marginalProbabilityCalibrationModel, const IJointProbabilityCalibrationModel &jointProbabilityCalibrationModel, uint32 numLabels) const = 0¶
Creates and returns a new instance of the class
IProbabilityPredictor, based on the type of this rule-based model.- 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 examplesoutputSpaceInfo – A reference to an object of type
IOutputSpaceInfothat provides information about the output space that may be used as a basis for making 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
-
inline virtual ~IRuleModel()¶