ImportError: cannot import name 'IsolationForest'

ImportError: cannot import name 'IsolationForest'

执行导入时

from sklearn.ensemble import IsolationForest

获取错误

Traceback (most recent call last):
File "<ipython-input-13-90a3d865c881>", line 1, in <module>
from sklearn.ensemble import IsolationForest

ImportError: cannot import name 'IsolationForest'

知道可能是什么问题吗?

你应该使用命令:

pip 安装-U sklearn

这一步将您的 sklearn(<0.18,maybe 0,17) 更新为 sklearn(0.18)