当我运行这段代码时:
from sklearn import cross_validation
bs = cross_validation.Bootstrap(9, random_state=0)
我收到这个弃用警告:
C:\Anaconda\envs\p33\lib\site-packages\sklearn\cross_validation.py:684: DeprecationWarning: Bootstrap will no longer be supported as a cross-validation method as of version 0.15 and will be removed in 0.17
"will be removed in 0.17", DeprecationWarning)
我应该使用什么来代替 Bootstrap ?
最佳答案
来自 the scikit-learn 0.15 release notes ,在“API 更改摘要”下
cross_validation.Bootstrap
is deprecated.cross_validation.KFold
orcross_validation.ShuffleSplit
are recommended instead.
# See, e.g., http://youtu.be/BzHz0J9a6k0?t=9m38s for a motivation
# behind this deprecation
warnings.warn("Bootstrap will no longer be supported as a " +
"cross-validation method as of version 0.15 and " +
"will be removed in 0.17", DeprecationWarning)
关于python - 我应该使用什么来代替 Bootstrap?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28030291/