[英]ImportError: cannot import name 'DecisionBoundaryDisplay' from 'sklearn.inspection'
I imported sklearn DecisionBoundaryDisplay via the below command in my Google Colab file.我通过 Google Colab 文件中的以下命令导入了 sklearn DecisionBoundaryDisplay。
from sklearn.inspection import DecisionBoundaryDisplay
And I'm getting the following error.我收到以下错误。
ImportError: cannot import name 'DecisionBoundaryDisplay' from 'sklearn.inspection' ImportError:无法从“sklearn.inspection”导入名称“DecisionBoundaryDisplay”
I even installed the following packages & also tried by restarting my runtime but still I'm getting the error.我什至安装了以下软件包并尝试重新启动运行时,但仍然出现错误。
!pip install --upgrade scikit-learn
!pip install scipy
!pip3 install -U scikit-learn scipy matplotlib
How to fix this issue?如何解决这个问题?
It seems DecisionBoundaryDisplay is a new feature and it is currently in an unstable development version.看来DecisionBoundaryDisplay是一项新功能,目前处于不稳定的开发版本中。 To use it, you need to install the nightly build .要使用它,您需要安装 nightly build 。
what worked for me was installing scikit learn 1.1.0, i had version 1.0.2 before and got the same error you're encountering.对我有用的是安装 scikit learn 1.1.0,我之前有 1.0.2 版并且遇到了同样的错误。
pip install -U scikit-learn --user pip install -U scikit-learn --user
Hope it helps.希望能帮助到你。
thank you.谢谢你。
pip install -U scikit-learn --user pip install -U scikit-learn --user
the above command worked and the error gone.上面的命令有效并且错误消失了。 decision boundaries are plotted.绘制决策边界。 ImportError: cannot import name 'DecisionBoundaryDisplay' from 'sklearn.inspection' (D:\anaconda\lib\site-packages\sklearn\inspection_ init _.py) ImportError: 无法从 'sklearn.inspection' 导入名称 'DecisionBoundaryDisplay' (D:\anaconda\lib\site-packages\sklearn\inspection_init _.py )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.