File post_optimization_sequential.hpp¶
-
class ISequentialPostOptimizationConfig¶
- #include <post_optimization_sequential.hpp>
Defines an interface for all classes that allow to configure a method that optimizes each rule in a model by relearning it in the context of the other rules. Multiple iterations, where the rules in a model are relearned in the order of their induction, may be carried out.
Subclassed by SequentialPostOptimizationConfig
Public Functions
-
inline virtual ~ISequentialPostOptimizationConfig()¶
-
virtual uint32 getNumIterations() const = 0¶
Returns the number of iterations that are performed for optimizing a model.
- Returns:
The number of iterations that are performed for optimizing a model
-
virtual ISequentialPostOptimizationConfig &setNumIterations(uint32 numIterations) = 0¶
Sets the number of iterations that should be performed for optimizing a model.
- Parameters:
numIterations – The number of iterations to be performed. Must be at least 1
- Returns:
A reference to an object of type
ISequentialPostOptimizationConfigthat allows further configuration of the optimization method
-
virtual bool areHeadsRefined() const = 0¶
Returns whether the heads of rules are refined when being relearned or not.
- Returns:
True, if the heads of rules are refined when being relearned, false otherwise
-
virtual ISequentialPostOptimizationConfig &setRefineHeads(bool refineHeads) = 0¶
Sets whether the heads of rules should be refined when being relearned or not.
- Parameters:
refineHeads – True, if the heads of rules should be refined when being relearned, false otherwise
- Returns:
A reference to an object of type
ISequentialPostOptimizationConfigthat allows further configuration of the optimization method
-
virtual bool areFeaturesResampled() const = 0¶
Returns whether a new sample of the available features is created whenever a new rule is refined or not.
- Returns:
True, if a new sample of the available features is created whenever a new rule is refined, false, if the conditions of the new rule use the same features as the original rule
-
virtual ISequentialPostOptimizationConfig &setResampleFeatures(bool resampleFeatures) = 0¶
Sets whether a new sample of the available features should be created whenever a new rule is refined or not.
- Parameters:
resampleFeatures – True, if a new sample of the available features should be created whenever a new rule is refined, false, if the conditions of the new rule should use the same features as the original rule
- Returns:
A reference to an object of type
ISequentialPostOptimizationConfigthat allows further configuration of the optimization method
-
inline virtual ~ISequentialPostOptimizationConfig()¶
-
class SequentialPostOptimizationConfig : public ISequentialPostOptimizationConfig, public IPostOptimizationPhaseConfig¶
- #include <post_optimization_sequential.hpp>
Allows to configure a method that optimizes each rule in a model by relearning it in the context of the other rules.
Public Functions
-
SequentialPostOptimizationConfig(ReadableProperty<IRuleInductionConfig> ruleInductionConfig)¶
- Parameters:
ruleInductionConfig – A
ReadablePropertythat allows to access theIRuleInductionConfigthat stores the configuration of the algorithm for the induction of individual rules
-
virtual uint32 getNumIterations() const override¶
Returns the number of iterations that are performed for optimizing a model.
- Returns:
The number of iterations that are performed for optimizing a model
-
virtual ISequentialPostOptimizationConfig &setNumIterations(uint32 numIterations) override¶
Sets the number of iterations that should be performed for optimizing a model.
- Parameters:
numIterations – The number of iterations to be performed. Must be at least 1
- Returns:
A reference to an object of type
ISequentialPostOptimizationConfigthat allows further configuration of the optimization method
-
virtual bool areHeadsRefined() const override¶
Returns whether the heads of rules are refined when being relearned or not.
- Returns:
True, if the heads of rules are refined when being relearned, false otherwise
-
virtual ISequentialPostOptimizationConfig &setRefineHeads(bool refineHeads) override¶
Sets whether the heads of rules should be refined when being relearned or not.
- Parameters:
refineHeads – True, if the heads of rules should be refined when being relearned, false otherwise
- Returns:
A reference to an object of type
ISequentialPostOptimizationConfigthat allows further configuration of the optimization method
-
virtual bool areFeaturesResampled() const override¶
Returns whether a new sample of the available features is created whenever a new rule is refined or not.
- Returns:
True, if a new sample of the available features is created whenever a new rule is refined, false, if the conditions of the new rule use the same features as the original rule
-
virtual ISequentialPostOptimizationConfig &setResampleFeatures(bool resampleFeatures) override¶
Sets whether a new sample of the available features should be created whenever a new rule is refined or not.
- Parameters:
resampleFeatures – True, if a new sample of the available features should be created whenever a new rule is refined, false, if the conditions of the new rule should use the same features as the original rule
- Returns:
A reference to an object of type
ISequentialPostOptimizationConfigthat allows further configuration of the optimization method
-
virtual std::unique_ptr<IPostOptimizationPhaseFactory> createPostOptimizationPhaseFactory(const IFeatureMatrix &featureMatrix, const IOutputMatrix &outputMatrix) const override¶
Creates and returns a new object of type
IPostOptimizationPhaseFactoryaccording to the specified configuration.- Parameters:
featureMatrix – A reference to an object of type
IFeatureMatrixthat provides access to the feature values of the training examplesoutputMatrix – A reference to an object of type
IOutputMatrixthat provides access to the ground truth of the training examples
- Returns:
An unique pointer to an object of type
IPostOptimizationPhaseFactorythat has been created
Private Members
-
const ReadableProperty<IRuleInductionConfig> ruleInductionConfig_¶
-
bool refineHeads_¶
-
bool resampleFeatures_¶
-
SequentialPostOptimizationConfig(ReadableProperty<IRuleInductionConfig> ruleInductionConfig)¶