ValueError:无法将字符串转换为浮点数-DNN

时间:2020-06-09 21:54:07

标签: python pandas numpy keras dotnetnuke

这是我的代码:

import keras
import numpy as np
import pandas as pd

df=pd.read_csv('khane-1.csv')
df.head()

x=df.drop(columns=['total'])
y=df[['total']]

model=keras.Sequential()
model.add(keras.layers.Dense(5,activation='relu',input_shape=(5,)))
model.add(keras.layers.Dense(5,activation='relu'))
model.add(keras.layers.Dense(1))

model.compile(optimizer='adam',loss='mean_squared_error')

model.fit(x,y,epochs=30,callbacks=[keras.callbacks.EarlyStopping(patience=5)])

我有这个错误: ValueError:无法将字符串转换为float:'shaghake ghods' error

0 个答案:

没有答案