当前位置:   article > 正文

ModuleNotFoundError: No module named ‘sklearn.grid_search‘问题的解决_from sklearn.ensemble import randomforestclassifie

from sklearn.ensemble import randomforestclassifier modulenotfounderror: no

问题描述:

from sklearn.grid_search import GridSearchCV时报错:

from sklearn.ensemble import RandomForestClassifier
from sklearn.grid_search import GridSearchCV

  • 1
  • 2
  • 3

ModuleNotFoundError Traceback (most recent call
last) ~\AppData\Local\Temp/ipykernel_13796/2171051172.py in
1 from sklearn.ensemble import RandomForestClassifier
----> 2 from sklearn.grid_search import GridSearchCV

ModuleNotFoundError: No module named ‘sklearn.grid_search’


原因分析:

sklearn版本更新


解决方案:

将from sklearn.grid_search import GridSearchCV换成from sklearn.model_selection import GridSearchCV

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/855023
推荐阅读
相关标签
  

闽ICP备14008679号