trainWeights = gradDescent(np.array(trainingSet,dtype=float64), trainingLabels)
把dtype设置为float64会报错 NameError: name 'float64' is not defined
但是如果去掉"dtype=float64"会出现warning:DataConversionWarning: Data with input dtype <U3 was converted to float64 by MinMaxScaler.
warnings.warn(msg, DataConversionWarning) 提醒被转换成了float64
请问应该如何显式转换呢?
Is it possible that you didn’t import float64
Of course it’s not right for you to import like this literally. .
Like this. .
float64 is a class under numpy. If you want to use float64 without modification, you need to import it like this
If there is no from numpy import float64, use it like this