Skip to content

Modification to work with scikit-learn >=1.3 y Eli5. #42

Closed
@raultomasmora

Description

@raultomasmora

Modification to work with scikit-learn >=1.3 y Eli5.
Resolves the issue of "ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators'"
sklearn.utils.metaestimators.if_delegate_has_method, deprecated since version 1.3. Use available_if instead.

Make the following changes in the code of this file "..\eli5\sklearn\permutation_importance.py"
(C:\Anaconda3\envs\python_3-12-4\Lib\site-packages\eli5\sklearn\permutation_importance.py)

Solución:
Change "from sklearn.utils.metaestimators import if_delegate_has_method"
by "from sklearn.utils.metaestimators import available_if"

and change all occurrences of "@if_delegate_has_method(delegate='wrapped_estimator_')"
by "@available_if('wrapped_estimator_')"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions