gpt4 book ai didi

scikit-learn - sklearn 的弃用警告

转载 作者:行者123 更新时间:2023-12-03 10:49:31 25 4
gpt4 key购买 nike

我正在使用 cross_validation来自sklearn,

from sklearn.cross_validation import train_test_split

我收到以下警告:

cross_validation.py:44: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved.

最佳答案

为避免这种情况,您只需更换:

from sklearn.cross_validation import train_test_split 

经过
from sklearn.model_selection import train_test_split

引用: skLearn

警告: DeprecationWarning:此模块在 0.18 版中已弃用,取而代之的是 model_selection 模块,所有重构的类和函数都移入其中。另请注意,新的 CV 迭代器的接口(interface)与此模块的接口(interface)不同。此模块将在 0.20 中删除。
“此模块将在 0.20 中删除。”,弃用警告)

关于scikit-learn - sklearn 的弃用警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43302400/

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