简体   繁体   English

无法从 sklearn.ensemble 导入任何内容

[英]Cannot import anything from sklearn.ensemble

from sklearn.ensemble._forest import VotingClassifier
from sklearn.ensemble import RandomForestRegressor

when I try to import anything from ensemble, there's always error like:当我尝试从 ensemble 导入任何东西时,总是会出现如下错误:

追溯

I tried我试过了

pip install -U scikit-learn
conda install -c conda-forge scikit-learn 

Don't mix conda with pip.不要将 conda 与 pip 混合使用。

Try these steps:尝试以下步骤:

  1. pip uninstall sklearn and then pip install -U scikit-learn pip uninstall sklearn然后pip install -U scikit-learn

  2. Replace代替

    from sklearn.ensemble._forest import VotingClassifier

    with

    from sklearn.ensemble import VotingClassifier

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 sklearn.ensemble 导入时出现导入错误? - IMPORT ERROR when importing from sklearn.ensemble? python warnings.filterwarnings 不会忽略“import sklearn.ensemble”中的 DeprecationWarning - python warnings.filterwarnings does not ignore DeprecationWarning from 'import sklearn.ensemble' sklearn.ensemble ImportError 中的 VotingClassifier - VotingClassifier in sklearn.ensemble ImportError 检查来自 sklearn.ensemble 的模型是否已适合数据 - Check if model from sklearn.ensemble has been fitted to data 可以在sklearn.ensemble中使用不同的分类器吗? - Is it possible to use different classifiers in sklearn.ensemble? sklearn.ensemble中的python特征选择特征重要性方法在多次运行中给出不一致的结果 - python feature selection feature importance method from sklearn.ensemble gives inconsistent results in multiple runs 导入 sklearn.ensemble 时收到错误 - Receiving error when I am importing sklearn.ensemble 输入适用于某些sklearn模型,但不适用于sklearn.linear和sklearn.ensemble中的其他模型 - Inputs working with some sklearn models but not other models in sklearn.linear and sklearn.ensemble Pyinstaller和sklearn.ensemble:'ModuleNotFoundError:没有名为'sklearn.neighbors.quad_tree'的模块[2760]' - Pyinstaller and sklearn.ensemble: 'ModuleNotFoundError: No module named 'sklearn.neighbors.quad_tree' [2760]' 无法从 sklearn 导入预测 - cannot import predict from sklearn
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM