FutureWarning: Arrays of bytes/strings is being converted to decimal numbers if
dtype='numeric'. This behavior is deprecated in 0.24 and will be removed in 1.1 (renaming of 0.26).
Please convert your data to numeric values explicitly instead.
请问这是什么意思?我一直在尝试部署我的模型,但是当我运行它时,这个问题不断出现
我相信无论是你的targets
or features
不是数字格式。
例如:
['1.0', '2.0', '3.0', '4.0'] # non-numeric format
[1.0, 2.0, 3.0, 4.0] # numeric format
您可以使用以下方法修复此问题numpy
或 for 循环如下:
a = ['1.0', '2.0', '3.0', '4.0'] # non-numeric format
b = np.array(a, dtype=float) # convert using numpy
c = [float(i) for i in a] # convert with for loop
据我了解,sklearn
会将非数字数组转换为数字,因此它无论如何都可以工作,但从警告来看,今后不会再出现这种情况。
下次请附上您的代码或部分代码,以便更轻松地为您提供帮助。
干杯。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)