Note
This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the What you really need to know section for the big picture.
julearn.models.dynamic.DynamicSelection¶
- class julearn.models.dynamic.DynamicSelection(ensemble, algorithm, ds_split=0.2, random_state=None, random_state_algorithm=None, **kwargs)¶
Model to use dynamic selection algorithms from DESlib.
- Parameters:
ensemble (
ModelLike) – sklearn compatible ensemble model. E.g RandomForestalgorithm – algorithm from deslib to make the model dynamic. Options:
- __init__(ensemble, algorithm, ds_split=0.2, random_state=None, random_state_algorithm=None, **kwargs)¶
- fit(X, y)¶
Fit the model.
- predict(X)¶
Predict using the model.
- predict_proba(X)¶
Compute probabilities of possible outcomes for samples in X.
- score(X, y, sample_weight=None)¶
Score the model.
- get_metadata_routing()¶
Get metadata routing of this object.
Please check User Guide on how the routing mechanism works.
- Returns:
A
MetadataRequestencapsulating routing information.
- get_params(deep=True)¶
Get parameters for this estimator.
- Parameters:
deep (bool, default=True) – If True, will return the parameters for this estimator and contained subobjects that are estimators.
- Returns:
Parameter names mapped to their values.
- set_params(**params)¶
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as
Pipeline). The latter have parameters of the form<component>__<parameter>so that it’s possible to update each component of a nested object.- Parameters:
**params (dict) – Estimator parameters.
- Returns:
Estimator instance.
- set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') DynamicSelection¶
Configure whether metadata should be requested to be passed to the
scoremethod.Note that this method is only relevant when this estimator is used as a sub-estimator within a meta-estimator and metadata routing is enabled with
enable_metadata_routing=True(seesklearn.set_config()). Please check the 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.
- Parameters:
sample_weight (str, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED) – Metadata routing for
sample_weightparameter inscore.- Returns:
The updated object.