mlrl.boosting.cython.learner module

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

class mlrl.boosting.cython.learner.AutomaticBinaryPredictorMixin

Bases: ABC

Allows to configure a rule learner to automatically decide for a predictor for predicting whether individual labels are relevant or irrelevant.

abstract use_automatic_binary_predictor()

Configures the rule learner to automatically decide for a predictor for predicting whether individual labels are relevant or irrelevant.

class mlrl.boosting.cython.learner.AutomaticDefaultRuleMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether a default rule should be induced or not.

abstract use_automatic_default_rule()

Configures the rule learner to automatically decide whether a default rule should be induced or not.

class mlrl.boosting.cython.learner.AutomaticFeatureBinningMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether a method for the assignment of numerical feature values to bins should be used or not.

abstract use_automatic_feature_binning()

Configures the rule learning to automatically decide whether a method for the assignment of numerical feature values to bins should be used or not.

class mlrl.boosting.cython.learner.AutomaticHeadMixin

Bases: ABC

Allows to configure a rule learner to automatically decide for the type of rule heads that should be used.

abstract use_automatic_heads()

Configures the rule learner to automatically decide for the type of rule heads to be used.

class mlrl.boosting.cython.learner.AutomaticLabelBinningMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether a method for the assignment of labels to bins should be used or not.

abstract use_automatic_label_binning()

Configures the rule learner to automatically decide whether a method for the assignment of labels to bins should be used or not.

class mlrl.boosting.cython.learner.AutomaticParallelRuleRefinementMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether multi-threading should be used for the parallel refinement of rules or not.

abstract use_automatic_parallel_rule_refinement()

Configures the rule learner to automatically decide whether multi-threading should be used for the parallel refinement of rules or not.

class mlrl.boosting.cython.learner.AutomaticParallelStatisticUpdateMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether multi-threading should be used for the parallel update of statistics or not.

abstract use_automatic_parallel_statistic_update()

Configures the rule learner to automatically decide whether multi-threading should be used for the parallel update of statistics or not.

class mlrl.boosting.cython.learner.AutomaticPartitionSamplingMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether a holdout set should be used or not.

abstract use_automatic_partition_sampling()

Configures the rule learner to automatically decide whether a holdout set should be used or not.

class mlrl.boosting.cython.learner.AutomaticProbabilityPredictorMixin

Bases: ABC

Allows to configure a rule learner to automatically decide for a predictor for predicting probability estimates.

abstract use_automatic_probability_predictor()

Configures the rule learner to automatically decide for a predictor for predicting probability estimates.

class mlrl.boosting.cython.learner.AutomaticStatisticsMixin

Bases: ABC

Allows to configure a rule learner to automatically decide whether a dense or sparse representation of gradients and Hessians should be used.

abstract use_automatic_statistics()

Configures the rule learner to automatically decide whether a dense or sparse representation of gradients and Hessians should be used.

class mlrl.boosting.cython.learner.CompleteHeadMixin

Bases: ABC

Allows to configure a rule learner to induce rules with complete heads that predict for all available labels.

abstract use_complete_heads()

Configures the rule learner to induce rules with complete heads that predict for all available labels.

class mlrl.boosting.cython.learner.ConstantShrinkageMixin

Bases: ABC

Allows to configure a rule learner to use a post processor that shrinks the weights fo rules by a constant “shrinkage” parameter.

abstract use_constant_shrinkage_post_processor() ConstantShrinkageConfig

Configures the rule learner to use a post-processor that shrinks the weights of rules by a constant “shrinkage” parameter.

Returns:

A ConstantShrinkageConfig that allows further configuration of the post-processor

class mlrl.boosting.cython.learner.DenseStatisticsMixin

Bases: ABC

Allows to configure a rule learner to use a dense representation of gradients and Hessians.

abstract use_dense_statistics()

Configures the rule learner to use a dense representation of gradients and Hessians.

class mlrl.boosting.cython.learner.DynamicPartialHeadMixin

Bases: ABC

Allows to configure a rule learner to induce rules with partial heads that predict for a subset of the available labels that is determined dynamically.

abstract use_dynamic_partial_heads() DynamicPartialHeadConfig

Configures the rule learner to induce rules with partial heads that predict for a subset of the available labels that is determined dynamically. Only those labels for which the square of the predictive quality exceeds a certain threshold are included in a rule head.

Returns:

A DynamicPartialHeadConfig that allows further configuration of the rule heads

class mlrl.boosting.cython.learner.EqualWidthLabelBinningMixin

Bases: ABC

Allows to configure a rule learner to use a method for the assignment of labels to bins.

abstract use_equal_width_label_binning() EqualWidthLabelBinningConfig

Configures the rule learner to use a method for the assignment of labels to bins in a way such that each bin contains labels for which the predicted score is expected to belong to the same value range.

Returns:

A EqualWidthLabelBinningConfig that allows further configuration of the method for the assignment of labels to bins

class mlrl.boosting.cython.learner.ExampleWiseBinaryPredictorMixin

Bases: ABC

Allows to configure a rule learner to use a predictor that predicts known label vectors for given query examples by comparing the predicted regression scores or probability estimates to the label vectors encountered in the training data.

abstract use_example_wise_binary_predictor() ExampleWiseBinaryPredictorConfig

Configures the rule learner to use a predictor that predicts known label vectors for given query examples by comparing the predicted regression scores or probability estimates to the label vectors encountered in the training data.

Returns:

An ExampleWiseBinaryPredictorConfig that allows further configuration of the predictor

class mlrl.boosting.cython.learner.ExampleWiseLogisticLossMixin

Bases: ABC

Allows to configure a rule learner to use a loss function that implements a multi-label variant of the logistic loss that is applied example-wise.

abstract use_example_wise_logistic_loss()

Configures the rule learner to use a loss function that implements a multi-label variant of the logistic loss that is applied example-wise.

class mlrl.boosting.cython.learner.ExampleWiseSquaredErrorLossMixin

Bases: ABC

Allows to configure a rule learner to use a loss function that implements a multi-label variant of the squared error loss that is applied example-wise.

abstract use_example_wise_squared_error_loss()

Configures the rule learner to use a loss function that implements a multi-label variant of the squared error loss that is applied example-wise.

class mlrl.boosting.cython.learner.ExampleWiseSquaredHingeLossMixin

Bases: ABC

Allows to configure a rule learner to use a loss function that implements a multi-label variant of the squared hinge loss that is applied example-wise.

abstract use_example_wise_squared_hinge_loss()

Configures the rule learner to use a loss function that implements a multi-label variant of the squared hinge loss that is applied example-wise.

class mlrl.boosting.cython.learner.FixedPartialHeadMixin

Bases: ABC

Allows to configure a rule learner to induce rules with partial heads that predict for a predefined number of labels.

abstract use_fixed_partial_heads() FixedPartialHeadConfig

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

Returns:

A FixedPartialHeadConfig that allows further configuration of the rule heads

class mlrl.boosting.cython.learner.GfmBinaryPredictorMixin

Bases: ABC

Allows to configure a rule learner to use a predictor that predicts whether individual labels of given query examples are relevant or irrelevant by discretizing the regression scores or probability estimates that are predicted for each label according to the general F-measure maximizer (GFM).

abstract use_gfm_binary_predictor() GfmBinaryPredictorConfig

Configures the rule learner to use a predictor that predicts whether individual labels of given query examples are relevant or irrelevant by discretizing the regression scores or probability estimates that are predicted for each label according to the general F-measure maximizer (GFM).

Returns:

A GfmBinaryPredictorConfig that allows further configuration of the predictor

class mlrl.boosting.cython.learner.IsotonicJointProbabilityCalibrationMixin

Bases: ABC

Allows to configure a rule learner to calibrate joint probabilities via isotonic regression.

abstract use_isotonic_joint_probability_calibration() IsotonicJointProbabilityCalibratorConfig

Configures the rule learner to calibrate joint probabilities via isotonic regression.

Returns:

An IsotonicJointProbabilityCalibratorConfig that allows further configuration of the calibrator

class mlrl.boosting.cython.learner.IsotonicMarginalProbabilityCalibrationMixin

Bases: ABC

Allows to configure a rule learner to calibrate marginal probabilities via isotonic regression.

abstract use_isotonic_marginal_probability_calibration() IsotonicMarginalProbabilityCalibratorConfig

Configures the rule learner to calibrate marginal probabilities via isotonic regression.

Returns:

An IsotonicMarginalProbabilityCalibratorConfig that allows further configuration of the calibrator

class mlrl.boosting.cython.learner.L1RegularizationMixin

Bases: ABC

Allows to configure a rule learner to use L1 regularization.

abstract use_l1_regularization() ManualRegularizationConfig

Configures the rule learner to use L1 regularization.

Returns:

A ManualRegularizationConfig that allows further configuration of the regularization term

class mlrl.boosting.cython.learner.L2RegularizationMixin

Bases: ABC

Allows to configure a rule learner to use L2 regularization.

abstract use_l2_regularization() ManualRegularizationConfig

Configures the rule learner to use L2 regularization.

Returns:

A ManualRegularizationConfig that allows further configuration of the regularization term

class mlrl.boosting.cython.learner.LabelWiseBinaryPredictorMixin

Bases: ABC

Allows to configure a predictor that predicts whether individual labels of given query examples are relevant or irrelevant by discretizing the regression scores or probability estimates that are predicted for each label individually.

abstract use_label_wise_binary_predictor() LabelWiseBinaryPredictorConfig

Configures the rule learner to use a predictor that predicts whether individual labels of given query examples are relevant or irrelevant by discretizing the regression scores or probability estimates that are predicted for each label individually.

Returns:

A LabelWiseBinaryPredictorConfig that allows further configuration of the predictor

class mlrl.boosting.cython.learner.LabelWiseLogisticLossMixin

Bases: ABC

Allows to configure a rule learner to use a loss function that implements a multi-label variant of the logistic loss that is applied label-wise.

abstract use_label_wise_logistic_loss()

Configures the rule learner to use a loss function that implements a multi-label variant of the logistic loss that is applied label-wise.

class mlrl.boosting.cython.learner.LabelWiseProbabilityPredictorMixin

Bases: ABC

Allows to configure a rule learner to use a predictor that predicts label-wise probabilities for given query examples by transforming the regression scores that are predicted for each label individually into probabilities.

abstract use_label_wise_probability_predictor() LabelWiseProbabilityPredictorConfig

Configures the rule learner to use a predictor that predicts label-wise probabilities for given query examples by transforming the regression scores that are predicted for each label individually into probabilities.

Returns:

A LabelWiseProbabilityPredictorConfig that allows further configuration of the predictor

class mlrl.boosting.cython.learner.LabelWiseScorePredictorMixin

Bases: ABC

Allows to configure a rule learner to use a predictor that predicts label-wise regression scores for given query examples by summing up the scores that are provided by individual rules for each label individually.

abstract use_label_wise_score_predictor()

Configures the rule learner to use a predictor that predict label-wise regression scores for given query examples by summing up the scores that are provided by individual rules for each label individually.

class mlrl.boosting.cython.learner.LabelWiseSquaredErrorLossMixin

Bases: ABC

Allows to configure a rule learner to use a loss function that implements a multi-label variant of the squared error loss that is applied label-wise.

abstract use_label_wise_squared_error_loss()

Configures the rule learner to use a loss function that implements a multi-label variant of the squared error loss that is applied label-wise.

class mlrl.boosting.cython.learner.LabelWiseSquaredHingeLossMixin

Bases: ABC

Allows to configure a rule learner to use a loss function that implements a multi-label variant of the squared hinge loss that is applied label-wise.

abstract use_label_wise_squared_hinge_loss()

Configures the rule learner to use a loss function that implements a multi-label variant of the squared hinge loss that is applied label-wise.

class mlrl.boosting.cython.learner.MarginalizedProbabilityPredictorMixin

Bases: ABC

Allows to configure a rule learner to use predictor for predicting probability estimates by summing up the scores that are provided by individual rules of an existing rule-based model and comparing the aggregated score vector to the known label vectors according to a certain distance measure.

abstract use_marginalized_probability_predictor() MarginalizedProbabilityPredictorConfig

Configures the rule learner to use a predictor for predicting probability estimates by summing up the scores that are provided by individual rules of an existing rule-based model and comparing the aggregated score vector to the known label vectors according to a certain distance measure. The probability for an individual label calculates as the sum of the distances that have been obtained for all label vectors, where the respective label is specified to be relevant, divided by the total sum of all distances.

Returns:

A MarginalizedProbabilityPredictorConfig that allows further configuration of the predictor

class mlrl.boosting.cython.learner.NoDefaultRuleMixin

Bases: ABC

Allows to configure a rule learner to not induce a default rule.

abstract use_no_default_rule()

Configures the rule learner to not induce a default rule.

class mlrl.boosting.cython.learner.NoL1RegularizationMixin

Bases: ABC

Allows to configure a rule learner to not use L1 regularization.

abstract use_no_l1_regularization()

Configures the rule learner to not use L1 regularization.

class mlrl.boosting.cython.learner.NoL2RegularizationMixin

Bases: ABC

Allows to configure a rule learner to not use L2 regularization.

abstract use_no_l2_regularization()

Configures the rule learner to not use L2 regularization.

class mlrl.boosting.cython.learner.NoLabelBinningMixin

Bases: ABC

Allows to configure a rule learner to not use any method for the assignment of labels to bins.

abstract use_no_label_binning()

Configures the rule learner to not use any method for the assignment of labels to bins.

class mlrl.boosting.cython.learner.SingleLabelHeadMixin

Bases: ABC

Allows to configure a rule learner to induce rules with single-label heads that predict for a single label.

abstract use_single_label_heads()

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

class mlrl.boosting.cython.learner.SparseStatisticsMixin

Bases: ABC

Allows to configure a rule learner to use a sparse representation of gradients and Hessians, if possible.

abstract use_sparse_statistics()

Configures the rule learner to use a sparse representation of gradients and Hessians, if possible.