mlrl.boosting.boosting_learners module¶
Author: Michael Rapp (michael.rapp.ml@gmail.com)
Provides scikit-learn implementations of boosting algorithms.
- class mlrl.boosting.boosting_learners.Boomer(random_state: int | None = None, feature_format: str | None = None, label_format: str | None = None, prediction_format: str | None = None, statistic_format: str | None = None, default_rule: str | None = None, rule_induction: str | None = None, max_rules: int | None = None, time_limit: int | None = None, global_pruning: str | None = None, sequential_post_optimization: str | None = None, head_type: str | None = None, loss: str | None = None, marginal_probability_calibration: str | None = None, joint_probability_calibration: str | None = None, binary_predictor: str | None = None, probability_predictor: str | None = None, label_sampling: str | None = None, instance_sampling: str | None = None, feature_sampling: str | None = None, holdout: str | None = None, feature_binning: str | None = None, label_binning: str | None = None, rule_pruning: str | None = None, shrinkage: float | None = 0.3, l1_regularization_weight: float | None = None, l2_regularization_weight: float | None = None, parallel_rule_refinement: str | None = None, parallel_statistic_update: str | None = None, parallel_prediction: str | None = None)¶
Bases:
RuleLearner
,ClassifierMixin
,RegressorMixin
,MultiOutputMixin
A scikit-learn implementation of “BOOMER”, an algorithm for learning gradient boosted multi-label classification rules.
- set_fit_request(*, x: bool | None | str = '$UNCHANGED$') Boomer ¶
Request metadata passed to the
fit
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed tofit
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it tofit
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.Parameters¶
- xstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
x
parameter infit
.
Returns¶
- selfobject
The updated object.
- set_predict_proba_request(*, x: bool | None | str = '$UNCHANGED$') Boomer ¶
Request metadata passed to the
predict_proba
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict_proba
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict_proba
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.Parameters¶
- xstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
x
parameter inpredict_proba
.
Returns¶
- selfobject
The updated object.
- set_predict_request(*, x: bool | None | str = '$UNCHANGED$') Boomer ¶
Request metadata passed to the
predict
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed topredict
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it topredict
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.Parameters¶
- xstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
x
parameter inpredict
.
Returns¶
- selfobject
The updated object.
- set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') Boomer ¶
Request metadata passed to the
score
method.Note that this method is only relevant if
enable_metadata_routing=True
(seesklearn.set_config()
). Please see User Guide on how the routing mechanism works.The options for each parameter are:
True
: metadata is requested, and passed toscore
if provided. The request is ignored if metadata is not provided.False
: metadata is not requested and the meta-estimator will not pass it toscore
.None
: metadata is not requested, and the meta-estimator will raise an error if the user provides it.str
: metadata should be passed to the meta-estimator with this given alias instead of the original name.
The default (
sklearn.utils.metadata_routing.UNCHANGED
) retains the existing request. This allows you to change the request for some parameters and not others.Added in version 1.3.
Note
This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a
Pipeline
. Otherwise it has no effect.Parameters¶
- sample_weightstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED
Metadata routing for
sample_weight
parameter inscore
.
Returns¶
- selfobject
The updated object.