File learner.hpp¶
-
namespace seco
-
class ISeCoRuleLearner : public virtual IRuleLearner¶
- #include <learner.hpp>
Defines an interface for all rule learners that make use of the separate-and-conquer (SeCo) paradigm.
Subclassed by seco::AbstractSeCoRuleLearner, seco::IMultiLabelSeCoRuleLearner
Public Functions
-
inline virtual ~ISeCoRuleLearner() override¶
-
class IAccuracyHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Accuracy” heuristic for learning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IAccuracyPruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Accuracy” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IConfig : public virtual IRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner that makes use of the separate-and-conquer (SeCo) paradigm.
Subclassed by seco::AbstractSeCoRuleLearner::Config, seco::IMultiLabelSeCoRuleLearner::IConfig, seco::ISeCoRuleLearner::IAccuracyHeuristicMixin, seco::ISeCoRuleLearner::IAccuracyPruningHeuristicMixin, seco::ISeCoRuleLearner::ICoverageStoppingCriterionMixin, seco::ISeCoRuleLearner::IFMeasureHeuristicMixin, seco::ISeCoRuleLearner::IFMeasurePruningHeuristicMixin, seco::ISeCoRuleLearner::IKlnLiftFunctionMixin, seco::ISeCoRuleLearner::ILabelWiseBinaryPredictionMixin, seco::ISeCoRuleLearner::ILaplaceHeuristicMixin, seco::ISeCoRuleLearner::ILaplacePruningHeuristicMixin, seco::ISeCoRuleLearner::IMEstimateHeuristicMixin, seco::ISeCoRuleLearner::IMEstimatePruningHeuristicMixin, seco::ISeCoRuleLearner::INoCoverageStoppingCriterionMixin, seco::ISeCoRuleLearner::INoLiftFunctionMixin, seco::ISeCoRuleLearner::IPartialHeadMixin, seco::ISeCoRuleLearner::IPeakLiftFunctionMixin, seco::ISeCoRuleLearner::IPrecisionHeuristicMixin, seco::ISeCoRuleLearner::IPrecisionPruningHeuristicMixin, seco::ISeCoRuleLearner::IRecallHeuristicMixin, seco::ISeCoRuleLearner::IRecallPruningHeuristicMixin, seco::ISeCoRuleLearner::ISingleLabelHeadMixin, seco::ISeCoRuleLearner::IWraHeuristicMixin, seco::ISeCoRuleLearner::IWraPruningHeuristicMixin
Public Functions
-
inline virtual ~IConfig() override¶
Protected Functions
-
virtual std::unique_ptr<CoverageStoppingCriterionConfig> &getCoverageStoppingCriterionConfigPtr() = 0¶
Returns an unique pointer to the configuration of the stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
- Returns:
A reference to an unique pointer of type
CoverageStoppingCriterionConfig
that stores the configuration of the stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold or a null pointer, if no such stopping criterion should be used
-
virtual std::unique_ptr<IHeadConfig> &getHeadConfigPtr() = 0¶
Returns an unique pointer to the configuration of the rule heads that should be induced by the rule learner.
- Returns:
A reference to an unique pointer of type
IHeadConfig
that stores the configuration of the rule heads
-
virtual std::unique_ptr<IHeuristicConfig> &getHeuristicConfigPtr() = 0¶
Returns an unique pointer to the configuration of the heuristic for learning rules.
- Returns:
A reference to an unique pointer of type
IHeuristicConfig
that stores the configuration of the heuristic for learning rules
-
virtual std::unique_ptr<IHeuristicConfig> &getPruningHeuristicConfigPtr() = 0¶
Returns an unique pointer to the configuration of the heuristic for pruning rules.
- Returns:
A reference to an unique pointer of type
IHeuristicConfig
that stores the configuration of the heuristic for pruning rules
-
virtual std::unique_ptr<ILiftFunctionConfig> &getLiftFunctionConfigPtr() = 0¶
Returns an unique pointer to the configuration of the lift function that affects the quality of rules, depending on the number of labels for which they predict.
- Returns:
A reference to an unique pointer of type
ILiftFunctionConfig
that stores the configuration of the lift function that affects the quality of rules, depending on the number of labels for which they predict
Friends
- friend class AbstractSeCoRuleLearner
-
inline virtual ~IConfig() override¶
-
class ICoverageStoppingCriterionMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use a stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~ICoverageStoppingCriterionMixin() override¶
-
inline virtual ICoverageStoppingCriterionConfig &useCoverageStoppingCriterion()¶
Configures the rule learner to use a stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
- Returns:
A reference to an object of type
ICoverageStoppingCriterionConfig
that allows further configuration of the stopping criterion
-
inline virtual ~ICoverageStoppingCriterionMixin() override¶
-
class IFMeasureHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “F-Measure” heuristic for learning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~IFMeasureHeuristicMixin() override¶
-
inline virtual IFMeasureConfig &useFMeasureHeuristic()¶
Configures the rule learner to use the “F-Measure” heuristic for learning rules.
- Returns:
A reference to an object of type
IFMeasureConfig
that allows further configuration of the heuristic
-
inline virtual ~IFMeasureHeuristicMixin() override¶
-
class IFMeasurePruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “F-Measure” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~IFMeasurePruningHeuristicMixin() override¶
-
inline virtual IFMeasureConfig &useFMeasurePruningHeuristic()¶
Configures the rule learner to use the “F-Measure” heuristic for pruning rules.
- Returns:
A reference to an object of type
IFMeasureConfig
that allows further configuration of the heuristic
-
inline virtual ~IFMeasurePruningHeuristicMixin() override¶
-
class IKlnLiftFunctionMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use a lift function that monotonously increases according to the natural logarithm of the number of labels for which a rule predicts.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~IKlnLiftFunctionMixin() override¶
-
inline virtual IKlnLiftFunctionConfig &useKlnLiftFunction()¶
Configures the rule learner to use a lift function that monotonously increases according to the natural logarithm of the number of labels for which a rule predicts.
- Returns:
A reference to an object of type
IKlnLiftFunctionConfig
that allows further configuration of the lift function
-
inline virtual ~IKlnLiftFunctionMixin() override¶
-
class ILabelWiseBinaryPredictionMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use a predictor for predicting whether individual labels of given query examples are relevant or irrelevant by processing rules of an existing rule-based model in the order they have been learned. If a rule covers an example, its prediction is applied to each label individually.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~ILabelWiseBinaryPredictionMixin() override¶
-
inline virtual void useLabelWiseBinaryPredictor()¶
Configures the rule learner to use a predictor for predicting whether individual labels of given query examples are relevant or irrelevant by processing rules of an existing rule-based model in the order they have been learned. If a rule covers an example, its prediction is applied to each label individually.
-
inline virtual ~ILabelWiseBinaryPredictionMixin() override¶
-
class ILaplaceHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Laplace” heuristic for learning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class ILaplacePruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Laplace” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IMEstimateHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “M-Estimate” heuristic for learning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~IMEstimateHeuristicMixin() override¶
-
inline virtual IMEstimateConfig &useMEstimateHeuristic()¶
Configures the rule learner to use the “M-Estimate” heuristic for learning rules.
- Returns:
A reference to an object of type
IMEstimateConfig
that allows further configuration of the heuristic
-
inline virtual ~IMEstimateHeuristicMixin() override¶
-
class IMEstimatePruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “M-Estimate” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~IMEstimatePruningHeuristicMixin() override¶
-
inline virtual IMEstimateConfig &useMEstimatePruningHeuristic()¶
Configures the rule learner to use the “M-Estimate” heuristic for pruning rules.
- Returns:
A reference to an object of type
IMEstimateConfig
that allows further configuration of the heuristic
-
inline virtual ~IMEstimatePruningHeuristicMixin() override¶
-
class INoCoverageStoppingCriterionMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to not use any stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~INoCoverageStoppingCriterionMixin() override¶
-
inline virtual void useNoCoverageStoppingCriterion()¶
Configures the rule learner to not use any stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
-
inline virtual ~INoCoverageStoppingCriterionMixin() override¶
-
class INoLiftFunctionMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to not use a lift function.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IPartialHeadMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to induce rules with partial heads.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IPeakLiftFunctionMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use a lift function that monotonously increases until a certain number of labels, where the maximum lift is reached, and monotonously decreases afterwards.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
Public Functions
-
inline virtual ~IPeakLiftFunctionMixin() override¶
-
inline virtual IPeakLiftFunctionConfig &usePeakLiftFunction()¶
Configures the rule learner to use a lift function that monotonously increases until a certain number of labels, where the maximum lift is reached, and monotonously decreases afterwards.
- Returns:
A reference to an object of type
IPeakLiftFunctionConfig
that allows further configuration of the lift function
-
inline virtual ~IPeakLiftFunctionMixin() override¶
-
class IPrecisionHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Precision” heuristic for learning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IPrecisionPruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Precision” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IRecallHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Recall” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IRecallPruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Recall” heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class ISingleLabelHeadMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to induce rules with single-label heads that predict for a single label.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IWraHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Weighted Relative
Accuracy” (WRA) heuristic for learning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
class IWraPruningHeuristicMixin : public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Defines an interface for all classes that allow to configure a rule learner to use the “Weighted Relative
Accuracy” (WRA) heuristic for pruning rules.
Subclassed by seco::IMultiLabelSeCoRuleLearner::IConfig
-
inline virtual ~ISeCoRuleLearner() override¶
-
class AbstractSeCoRuleLearner : public AbstractRuleLearner, public virtual seco::ISeCoRuleLearner¶
- #include <learner.hpp>
An abstract base class for all rule learners that make use of the separate-and-conquer (SeCo) paradigm.
Subclassed by seco::MultiLabelSeCoRuleLearner
Public Functions
-
AbstractSeCoRuleLearner(ISeCoRuleLearner::IConfig &config)¶
- Parameters:
config – A reference to an object of type
ISeCoRuleLearner::IConfig
that specifies the configuration that should be used by the rule learner
Protected Functions
-
void createStoppingCriterionFactories(StoppingCriterionListFactory &factory) const override¶
See also
AbstractRuleLearner::createStoppingCriterionFactories
-
std::unique_ptr<IStatisticsProviderFactory> createStatisticsProviderFactory(const IFeatureMatrix &featureMatrix, const IRowWiseLabelMatrix &labelMatrix) const override¶
See also
AbstractRuleLearner::createStatisticsProviderFactory
-
std::unique_ptr<IModelBuilderFactory> createModelBuilderFactory() const override¶
See also
AbstractRuleLearner::createModelBuilderFactory
-
std::unique_ptr<ISparseBinaryPredictorFactory> createSparseBinaryPredictorFactory(const IRowWiseFeatureMatrix &featureMatrix, uint32 numLabels) const override¶
See also
AbstractRuleLearner::createSparseBinaryPredictorFactory
Private Functions
-
std::unique_ptr<IStoppingCriterionFactory> createCoverageStoppingCriterionFactory() const¶
Private Members
-
ISeCoRuleLearner::IConfig &config_¶
-
class Config : public AbstractRuleLearner::Config, public virtual seco::ISeCoRuleLearner::IConfig¶
- #include <learner.hpp>
Allows to configure a rule learner that makes use of the separate-and-conquer (SeCo) paradigm.
Subclassed by seco::MultiLabelSeCoRuleLearner::Config
Public Functions
-
Config()¶
Protected Attributes
-
std::unique_ptr<CoverageStoppingCriterionConfig> coverageStoppingCriterionConfigPtr_¶
An unique pointer that stores the configuration of the stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
-
std::unique_ptr<IHeadConfig> headConfigPtr_¶
An unique pointer that stores the configuration of the rule heads.
-
std::unique_ptr<IHeuristicConfig> heuristicConfigPtr_¶
An unique pointer that stores the configuration of the heuristic that is used for learning rules.
-
std::unique_ptr<IHeuristicConfig> pruningHeuristicConfigPtr_¶
An unique pointer that stores the configuration of the heuristic that is used for pruning rules.
-
std::unique_ptr<ILiftFunctionConfig> liftFunctionConfigPtr_¶
An unique pointer that stores the configuration of the lift function that affects the quality of rules, depending on the number of labels for which they predict.
Private Functions
-
virtual std::unique_ptr<CoverageStoppingCriterionConfig> &getCoverageStoppingCriterionConfigPtr() final override¶
Returns an unique pointer to the configuration of the stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold.
- Returns:
A reference to an unique pointer of type
CoverageStoppingCriterionConfig
that stores the configuration of the stopping criterion that stops the induction of rules as soon as the sum of the weights of the uncovered labels is smaller or equal to a certain threshold or a null pointer, if no such stopping criterion should be used
-
virtual std::unique_ptr<IHeadConfig> &getHeadConfigPtr() final override¶
Returns an unique pointer to the configuration of the rule heads that should be induced by the rule learner.
- Returns:
A reference to an unique pointer of type
IHeadConfig
that stores the configuration of the rule heads
-
virtual std::unique_ptr<IHeuristicConfig> &getHeuristicConfigPtr() final override¶
Returns an unique pointer to the configuration of the heuristic for learning rules.
- Returns:
A reference to an unique pointer of type
IHeuristicConfig
that stores the configuration of the heuristic for learning rules
-
virtual std::unique_ptr<IHeuristicConfig> &getPruningHeuristicConfigPtr() final override¶
Returns an unique pointer to the configuration of the heuristic for pruning rules.
- Returns:
A reference to an unique pointer of type
IHeuristicConfig
that stores the configuration of the heuristic for pruning rules
-
virtual std::unique_ptr<ILiftFunctionConfig> &getLiftFunctionConfigPtr() final override¶
Returns an unique pointer to the configuration of the lift function that affects the quality of rules, depending on the number of labels for which they predict.
- Returns:
A reference to an unique pointer of type
ILiftFunctionConfig
that stores the configuration of the lift function that affects the quality of rules, depending on the number of labels for which they predict
-
Config()¶
-
AbstractSeCoRuleLearner(ISeCoRuleLearner::IConfig &config)¶
-
class ISeCoRuleLearner : public virtual IRuleLearner¶