date a b c d e
10-01-2020 1 2 3 4 5
df = 11-01-2020 8 5 6 3 7
12-01-2020 6 4 11 9 8
13-01-2020 8 7 12 8 7
train_df,test_df = df[1:3], df[3:]
train = train_df
scalers={}
for i in train_df.columns:
scaler = MinMaxScaler(feature_range=(-1,1))
s_s = scaler.fit_transform(train[i].values.reshape(-1,1))
s_s=np.reshape(s_s,len(s_s))
scalers['scaler_'+ i] = scaler
train[i]=s_s
test = test_df
for i in train_df.columns:
scaler = scalers['scaler_'+i]
s_s = scaler.transform(test[i].values.reshape(-1,1))
s_s=np.reshape(s_s,len(s_s))
scalers['scaler_'+i] = scaler
test[i]=s_s
i am using stacked Lstm to predict the value of next column for each column but i am getting a value error.Value Error: could not convert string to float: '12-01-2020'should i remove the date column or bypass??? or should i use different time series modeling for this problem?
You cannot convert date to float as there is a hyphen in the date string.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.