简体   繁体   English

ImportError:无法从“sklearn.inspection”导入名称“DecisionBoundaryDisplay”

[英]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.

相关问题 来自sklearn import svm ImportError:无法导入名称lsqr - from sklearn import svm ImportError: cannot import name lsqr ModuleNotFoundError:没有名为“sklearn.inspection”的模块 - ModuleNotFoundError: No module named 'sklearn.inspection' ImportError:无法从“ sklearn.base”导入名称“ _UnstableArchMixin” - ImportError: cannot import name '_UnstableArchMixin' from 'sklearn.base' 导入错误:无法从“sklearn.model_selection”导入名称“StratifiedGroupKFold” - ImportError: cannot import name 'StratifiedGroupKFold' from 'sklearn.model_selection' ImportError:无法从“sklearn.utils.fixes”导入名称“_argmax” - ImportError: cannot import name '_argmax' from 'sklearn.utils.fixes' ImportError:无法从“sklearn”(未知位置)导入名称“__version__” - ImportError: cannot import name '__version__' from 'sklearn' (unknown location) 从 sklearn 导入时出现导入错误:无法导入名称 check_build - ImportError in importing from sklearn: cannot import name check_build ImportError:无法从“sklearn.model_selection”导入名称“HalvingGridSearchCV” - ImportError: cannot import name 'HalvingGridSearchCV' from 'sklearn.model_selection' ImportError:无法从“sklearn.base”导入名称“_ClassNamePrefixFeaturesOutMixin” - ImportError: cannot import name '_ClassNamePrefixFeaturesOutMixin' from 'sklearn.base' ImportError:无法为sklearn导入名称“树” - ImportError: cannot import name 'tree' for sklearn
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM