mlrl.seco.cython.learner_seco module

@author: Michael Rapp (michael.rapp.ml@gmail.com)

class mlrl.seco.cython.learner_seco.SeCoClassifier

Bases: ClassificationRuleLearner

The multi-label SeCo algorithm for classification problems.

class mlrl.seco.cython.learner_seco.SeCoClassifierConfig

Bases: RuleLearnerConfig, RNGMixin, NoCoverageStoppingCriterionMixin, CoverageStoppingCriterionMixin, SingleOutputHeadMixin, PartialHeadMixin, NoLiftFunctionMixin, PeakLiftFunctionMixin, KlnLiftFunctionMixin, AccuracyHeuristicMixin, AccuracyPruningHeuristicMixin, FMeasureHeuristicMixin, FMeasurePruningHeuristicMixin, MEstimateHeuristicMixin, MEstimatePruningHeuristicMixin, LaplaceHeuristicMixin, LaplacePruningHeuristicMixin, PrecisionHeuristicMixin, PrecisionPruningHeuristicMixin, RecallHeuristicMixin, RecallPruningHeuristicMixin, WraHeuristicMixin, WraPruningHeuristicMixin, OutputWiseBinaryPredictionMixin, SequentialRuleModelAssemblageMixin, DefaultRuleMixin, GreedyTopDownRuleInductionMixin, BeamSearchTopDownRuleInductionMixin, NoFeatureBinningMixin, EqualWidthFeatureBinningMixin, EqualFrequencyFeatureBinningMixin, NoOutputSamplingMixin, RoundRobinOutputSamplingMixin, OutputSamplingWithoutReplacementMixin, NoInstanceSamplingMixin, InstanceSamplingWithReplacementMixin, InstanceSamplingWithoutReplacementMixin, OutputWiseStratifiedInstanceSamplingMixin, ExampleWiseStratifiedInstanceSamplingMixin, NoFeatureSamplingMixin, FeatureSamplingWithoutReplacementMixin, NoPartitionSamplingMixin, RandomBiPartitionSamplingMixin, OutputWiseStratifiedBiPartitionSamplingMixin, ExampleWiseStratifiedBiPartitionSamplingMixin, NoRulePruningMixin, IrepRulePruningMixin, NoParallelRuleRefinementMixin, ParallelRuleRefinementMixin, NoParallelStatisticUpdateMixin, ParallelStatisticUpdateMixin, NoParallelPredictionMixin, ParallelPredictionMixin, NoSizeStoppingCriterionMixin, SizeStoppingCriterionMixin, NoTimeStoppingCriterionMixin, TimeStoppingCriterionMixin, NoSequentialPostOptimizationMixin, SequentialPostOptimizationMixin

Allows to configure the multi-label SeCo algorithm.

use_accuracy_heuristic()

Configures the rule learner to use the “Accuracy” heuristic for learning rules.

use_accuracy_pruning_heuristic()

Configures the rule learner to use the “Accuracy” heuristic for pruning rules.

use_beam_search_top_down_rule_induction() BeamSearchTopDownRuleInductionConfig

Configures the algorithm to use a top-down beam search for the induction of individual rules.

Returns:

A BeamSearchTopDownRuleInductionConfig that allows further configuration of the algorithm for the induction of individual rules

use_coverage_stopping_criterion() CoverageStoppingCriterionConfig

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 CoverageStoppingCriterionConfig that allows further configuration of the stopping criterion

use_default_rule()

Configures the rule learner to induce a default rule.

use_equal_frequency_feature_binning() EqualFrequencyFeatureBinningConfig

Configures the rule learner to use a method for the assignment of numerical feature values to bins, such that each bin contains approximately the same number of values.

Returns:

An EqualFrequencyFeatureBinningConfig that allows further configuration of the method for the assignment of numerical feature values to bins

use_equal_width_feature_binning() EqualWidthFeatureBinningConfig

Configures the rule learner to use a method for the assignment of numerical feature values to bins, such that each bin contains values from equally sized value ranges.

Returns:

An EqualWidthFeatureBinningConfig that allows further configuration of the method for the assignment of numerical feature values to bins

use_example_wise_stratified_bi_partition_sampling() ExampleWiseStratifiedBiPartitionSamplingConfig

Configures the rule learner to partition the available training examples into a training set and a holdout set using stratification, where distinct label vectors are treated as individual classes

Returns:

An ExampleWiseStratifiedBiPartitionSamplingConfig that allows further configuration of the method for partitioning the available training examples into a training and a holdout set

use_example_wise_stratified_instance_sampling() ExampleWiseStratifiedInstanceSamplingConfig

Configures the rule learner to sample from the available training examples using stratification, where distinct label vectors are treated as individual classes, whenever a new rule should be learned.

Returns:

An ExampleWiseStratifiedInstanceSamplingConfig that allows further configuration of the method for sampling instances

use_f_measure_heuristic() FMeasureConfig

Configures the rule learner to use the “F-Measure” heuristic for learning rules.

Returns:

A FMeasureConfig that allows further configuration of the heuristic

use_f_measure_pruning_heuristic() FMeasureConfig

Configures the rule learner to use the “F-Measure” heuristic for pruning rules.

Returns:

A FMeasureConfig that allows further configuration of the heuristic

use_feature_sampling_without_replacement() FeatureSamplingWithoutReplacementConfig

Configures the rule learner to sample from the available features with replacement whenever a rule should be refined.

Returns:

A FeatureSamplingWithoutReplacementConfig that allows further configuration of the method for sampling features

use_greedy_top_down_rule_induction() GreedyTopDownRuleInductionConfig

Configures the algorithm to use a greedy top-down search for the induction of individual rules.

Returns:

A GreedyTopDownRuleInductionConfig that allows further configuration of the algorithm for the induction of individual rules

use_instance_sampling_with_replacement() InstanceSamplingWithReplacementConfig

Configures the rule learner to sample from the available training examples with replacement whenever a new rule should be learned.

Returns:

An InstanceSamplingWithReplacementConfig that allows further configuration of the method for sampling instances

use_instance_sampling_without_replacement() InstanceSamplingWithoutReplacementConfig

Configures the rule learner to sample from the available training examples without replacement whenever a new rule should be learned.

Returns:

An InstanceSamplingWithoutReplacementConfig that allows further configuration of the method for sampling instances

use_irep_rule_pruning()

Configures the rule learner to prune individual rules by following the principles of “incremental reduced error pruning” (IREP).

use_kln_lift_function() KlnLiftFunctionConfig

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 KlnLiftFunctionConfig that allows further configuration of the lift function

use_laplace_heuristic()

Configures the rule learner to use the “Laplace” heuristic for learning rules.

use_laplace_pruning_heuristic()

Configures the rule learner to use the “Laplace” heuristic for pruning rules.

use_m_estimate_heuristic() MEstimateConfig

Configures the rule learner to use the “M-Estimate” heuristic for learning rules.

Returns:

A MEstimateConfig that allows further configuration of the heuristic

use_m_estimate_pruning_heuristic() MEstimateConfig

Configures the rule learner to use the “M-Estimate” heuristic for pruning rules.

Returns:

A MEstimateConfig that allows further configuration of the heuristic

use_no_coverage_stopping_criterion()

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.

use_no_feature_binning()

Configures the rule learner to not use any method for the assignment of numerical feature values to bins.

use_no_feature_sampling()

Configures the rule learner to not sample from the available features whenever a rule should be refined.

use_no_instance_sampling()

Configures the rule learner to not sample from the available training examples whenever a new rule should be learned.

use_no_lift_function()

Configures the rule learner to not use a lift function.

use_no_output_sampling()

Configures the rule learner to not sample from the available outputs whenever a new rule should be learned.

use_no_parallel_prediction()

Configures the rule learner to not use any multi-threading to predict for several query examples in parallel.

use_no_parallel_rule_refinement()

Configures the rule learner to not use any multi-threading for the parallel refinement of rules.

use_no_parallel_statistic_update()

Configures the rule learner to not use any multi-threading for the parallel update of statistics.

use_no_partition_sampling()

Configures the rule learner to not partition the available training examples into a training set and a holdout set.

use_no_rule_pruning()

Configures the rule learner to not prune individual rules.

use_no_sequential_post_optimization()

Configures the rule learner to not use a post-optimization method that optimizes each rule in a model by relearning it in the context of the other rules.

use_no_size_stopping_criterion()

Configures the rule learner to not use a stopping criterion that ensures that the number of induced rules does not exceed a certain maximum.

use_no_time_stopping_criterion()

Configures the rule learner to not use a stopping criterion that ensures that a certain time limit is not exceeded.

use_output_sampling_without_replacement() OutputSamplingWithoutReplacementConfig

Configures the rule learner to sample from the available outputs with replacement whenever a new rule should be learned.

Returns:

An OutputSamplingWithoutReplacementConfig that allows further configuration of the sampling method

use_output_wise_binary_predictor()

Configures the rule learner to use 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.

use_output_wise_stratified_bi_partition_sampling() OutputWiseStratifiedBiPartitionSamplingConfig

Configures the rule learner to partition the available training examples into a training set and a holdout set using stratification, such that for each label the proportion of relevant and irrelevant examples is maintained.

Returns:

An OutputWiseStratifiedBiPartitionSamplingConfig that allows further configuration of the method for partitioning the available training examples into a training and a holdout set

use_output_wise_stratified_instance_sampling() OutputWiseStratifiedInstanceSamplingConfig

Configures the rule learner to sample from the available training examples using stratification, such that for each label the proportion of relevant and irrelevant examples is maintained, whenever a new rule should be learned.

Returns:

An OutputWiseStratifiedInstanceSamplingConfig that allows further configuration of the method for sampling instances

use_parallel_prediction() ManualMultiThreadingConfig

Configures the rule learner to use multi-threading to predict for several query examples in parallel.

Returns:

A ManualMultiThreadingConfig that allows further configuration of the multi-threading behavior

use_parallel_rule_refinement() ManualMultiThreadingConfig

Configures the rule learner to use multi-threading for the parallel refinement of rules.

Returns:

A ManualMultiThreadingConfig that allows further configuration of the multi-threading behavior

use_parallel_statistic_update() ManualMultiThreadingConfig

Configures the rule learner to use multi-threading for the parallel update of statistics.

Returns:

A ManualMultiThreadingConfig that allows further configuration of the multi-threading behavior

use_partial_heads()

Configures the rule learner to induce rules with partial heads that predict for a subset of the available labels.

use_peak_lift_function() PeakLiftFunctionConfig

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 PeakLiftFunctionConfig that allows further configuration of the lift function

use_precision_heuristic()

Configures the rule learner to use the “Precision” heuristic for learning rules.

use_precision_pruning_heuristic()

Configures the rule learner to use the “Precision” heuristic for pruning rules.

use_random_bi_partition_sampling() RandomBiPartitionSamplingConfig

Configures the rule learner to partition the available training examples into a training set and a holdout set by randomly splitting the training examples into two mutually exclusive sets.

Returns:

A RandomBiPartitionSamplingConfig that allows further configuration of the method for partitioning the available training examples into a training set and a holdout set

use_recall_heuristic()

Configures the rule learner to use the “Recall” heuristic for learning rules.

use_recall_pruning_heuristic()

Configures the rule learner to use the “Recall” heuristic for pruning rules.

use_rng() RNGConfig

Configures the random number generators that are used by the rule learner.

Returns:

An RNGConfig that allows further configuration of the random number generators

use_round_robin_output_sampling()

Configures the rule learner to sample a one output at a time in a round-robin fashion whenever a new rule should be learned.

use_sequential_post_optimization() SequentialPostOptimizationConfig

Configures the rule learner to use a post-optimization method that optimizes each rule in a model by relearning it in the context of the other rules.

Returns:

A SequentialPostOptimizationConfig that allows further configuration of the post-optimization method

use_sequential_rule_model_assemblage()

Configures the rule learner to use an algorithm that sequentially induces several rules, optionally starting with a default rule, that are added to a rule-based model.

use_single_output_heads()

Configures the rule learner to induce rules with single-output heads that predict for a single output.

use_size_stopping_criterion() SizeStoppingCriterionConfig

Configures the rule learner to use a stopping criterion that ensures that the number of induced rules does not exceed a certain maximum.

Returns:

A SizeStoppingCriterionConfig that allows further configuration of the stopping criterion

use_time_stopping_criterion() TimeStoppingCriterionConfig

Configures the rule learner to use a stopping criterion that ensures that a certain time limit is not exceeded.

Returns:

A TimeStoppingCriterionConfig that allows further configuration of the stopping criterion

use_wra_heuristic()

Configures the rule learner to use the “Weighted Relative Accuracy” heuristic for learning rules.

use_wra_pruning_heuristic()

Configures the rule learner to use the “Weighted Relative Accuracy” heuristic for pruning rules.