본문 바로가기
ERROR

ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators'

by ram_ 2024. 1. 12.

 

 

eli5를 install하고 import 하는 과정에서 발생한 에러이다.

colab에서 진행하면 발생하지 않지만, local에서 작업하는 것을 더 선호해서 해결하고 싶었다. 

 

 

 

ImportError: cannot import name 'if_delegate_has_method' from 'sklearn.utils.metaestimators' with scikit-learn 1.3.0 · Issue #4

Hi All, Looks like SKL 1.3.0 may have broken things! System information OS Platform and Distribution: Windows 11 Pro Sklearn-genetic version: 0.5.1 deap version: 1.4.1 Scikit-learn version: 1.3.0 P...

github.com

 

 

위 링크에서 해당 issue를 다루고 있는 것을 확인했다.

 

하단 링크의 commit을 살펴보니 실제로 error log에 거론되었던 부분이었다.

 

sklearn의 permutation_importance.py를 수정해주니 해결됐다. 

해당 이슈가 수정된 버전은 이번달 즈음에 release될 것 같다. 

 

 

 

 

Update for modern versions of sklearn and numpy · manuel-calzolari/sklearn-genetic@12ee9b2

manuel-calzolari committed Aug 19, 2023

github.com