-
Notifications
You must be signed in to change notification settings - Fork 44
Modification to work with scikit-learn >=1.3 y Eli5. #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
i have same problem , how can i fix it ? or it will be fixed ? |
Search in your computer for the following file "...\eli5\sklearn\permutation_importance.py" In Win10 I have it with Anaconda in this link: "C:\Anaconda3\envs\name_of_your_environment\Lib\site-packages\eli5\sklearn\permutation_importance.py" You open it, modify the following texts and save it.
Attached modified file |
thanks, but when it will be released in pip ? |
hi, we'll try to do a release on pip with the fixes, sorry for a delay |
i modified files but this code throws another error : import warnings
|
If I am not wrong, I believe that “PermutationImportance” from the “eli5” library is not intended for use with sklearn's RFECV. The error you get is generated by the sklearn library. Try this code without RFECV:
You can also use permutation_importance from sklearn. https://scikit-learn.org/stable/modules/generated/sklearn.inspection.permutation_importance.html |
Any update here on the fix? Would be nice to have it as it hinders mi ci pipeline where i cant fix this the manual way... |
You have the manual solution above, in the following link. You can replace your file "permutation_importance.py" in your folder "C:\Anaconda3\envs\name_of_your_environment\Lib\site-packages\eli5\sklearn\permutation_importance.py" |
It's a bad practice if I would do it this way in my docker file. For some local EDA it's okay but not for productive code... |
This should be fixed by #48, we'll make a PyPI release soon. |
this was release on PyPI as 0.14.0, closing |
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. Useavailable_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_')
"The text was updated successfully, but these errors were encountered: