x0=data[3:18000,:]
y0=data[3:18000,-1]
sc = MinMaxScaler(feature_range=(0, 1))
x = sc.fit_transform(x0)
y0=y0.reshape(-1,1)
scc = MinMaxScaler(feature_range=(0, 1))
y = scc.fit_transform(y0)
x_t = []
y_t = []
x_train = []
y_train = []
x_test = []
y0_test = []
num_his_input=5
num_predmax_output=1
num_input=65
for i in range(num_his_input, len(y)-num_predmax_output):
x_t.append(x[i - num_his_input:i,:])
y_t.append(y[i:i+num_predmax_output,:])
x_t, y_t = np.array(x_t), np.array(y_t)#预测当前值t
x_t = np.reshape(x_t, (x_t.shape[0], num_his_input, num_input))
y_t=y_t.reshape(-1,num_predmax_output)
x_train=x_t[0:16000,:]
y_train=y_t[0:16000,:]
x_test=x_t[16000:17000,:]
y0_test=y_t[16000:17000,:]
np.random.seed(7)
np.random.shuffle(x_train)
np.random.seed(7)
np.random.shuffle(y_train)
tf.random.set_seed(7)