model = Sequential()
model.add(LSTM(512, input_shape=(None, 1), return_sequences=True))
model.add(Dropout(0.3))
model.add(LSTM(512, input_shape=(None, 1)))
model.add(Dropout(0.3))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='rmsprop', metrics=['accuracy'])
model.summary()
hist = model.fit(x_train, y_train, epochs=10, batch_size=16, verbose=2)
p = model.predict(x_test)
我有这段代码,可以预测模型p
。我想将p
的时间序列转换为线性回归模型。
Time series p -> linear regression model.
我该怎么做?