gpt4 book ai didi

scikit-learn - sklearn 模型选择错误 : ImportError: cannot import name '_approximate_mode'

转载 作者:行者123 更新时间:2023-12-01 21:56:38 25 4
gpt4 key购买 nike

我正在尝试导入 sklearn model_selection 但出现以下错误:

ImportError                               Traceback (most recent call last)
<ipython-input-219-6bc6f0a77ca9> in <module>()
----> 1 import sklearn.model_selection

~/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/__init__.py in <module>()
----> 1 from ._split import BaseCrossValidator
2 from ._split import KFold
3 from ._split import GroupKFold
4 from ._split import StratifiedKFold
5 from ._split import TimeSeriesSplit

~/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/_split.py in <module>()
21
22 from ..utils import indexable, check_random_state, safe_indexing
---> 23 from ..utils import _approximate_mode
24 from ..utils.validation import _num_samples, column_or_1d
25 from ..utils.validation import check_array

ImportError: cannot import name '_approximate_mode'

我尝试卸载 scikit-learn 并重新安装它,但我遇到了同样的错误。我当前的 scikit-learn 版本是 0.21.2。感谢您的帮助!

最佳答案

我关闭内核并重新启动它。现在它工作正常!谢谢!!

关于scikit-learn - sklearn 模型选择错误 : ImportError: cannot import name '_approximate_mode' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56540967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com