mlrl.seco.seco_learners module¶
Author: Michael Rapp (michael.rapp.ml@gmail.com)
Provides a scikit-learn implementation of a Separate-and-Conquer (SeCo) algorithm for learning multi-label classification rules.
- class mlrl.seco.seco_learners.SeCoClassifier(random_state: int | None = None, feature_format: str | None = None, output_format: str | None = None, prediction_format: str | None = None, rule_induction: str | None = None, max_rules: int | None = None, time_limit: int | None = None, sequential_post_optimization: str | None = None, head_type: str | None = None, lift_function: str | None = None, heuristic: str | None = None, pruning_heuristic: str | None = None, output_sampling: str | None = None, instance_sampling: str | None = None, feature_sampling: str | None = None, holdout: str | None = None, feature_binning: str | None = None, rule_pruning: str | None = None, parallel_rule_refinement: str | None = None, parallel_statistic_update: str | None = None, parallel_prediction: str | None = None)¶
Bases:
ClassificationRuleLearner,ClassifierMixinA scikit-learn implementation of a Separate-and-Conquer (SeCo) algorithm for learning multi-label classification rules.
- set_fit_request(*, x: bool | None | str = '$UNCHANGED$') SeCoClassifier¶
Request metadata passed to the
fitmethod.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 tofitif 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
xparameter infit.
Returns¶
- selfobject
The updated object.
- set_predict_proba_request(*, x: bool | None | str = '$UNCHANGED$') SeCoClassifier¶
Request metadata passed to the
predict_probamethod.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_probaif 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
xparameter inpredict_proba.
Returns¶
- selfobject
The updated object.
- set_predict_request(*, x: bool | None | str = '$UNCHANGED$') SeCoClassifier¶
Request metadata passed to the
predictmethod.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 topredictif 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
xparameter inpredict.
Returns¶
- selfobject
The updated object.
- set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') SeCoClassifier¶
Request metadata passed to the
scoremethod.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 toscoreif 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_weightparameter inscore.
Returns¶
- selfobject
The updated object.