mistermprah commited on
Commit
117f2f8
1 Parent(s): 926c2a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -84,11 +84,11 @@ def predict_next_month_price(ticker):
84
  predictions = []
85
  for _ in range(30):
86
  pred = lstm_model.predict(x_test_lstm[-1].reshape(1, 60, 1))
87
- predictions.append(pred)
88
- x_test_lstm = np.append(x_test_lstm, pred.reshape(1, 1, 1), axis=1)
89
- x_test_lstm = x_test_lstm[:, 1:, :]
90
 
91
- predictions = np.array(predictions).reshape(-1, 1)
92
  next_month_predictions = scaler.inverse_transform(predictions)
93
  next_month_price = next_month_predictions[-1][0]
94
 
 
84
  predictions = []
85
  for _ in range(30):
86
  pred = lstm_model.predict(x_test_lstm[-1].reshape(1, 60, 1))
87
+ predictions.append(pred[0])
88
+ x_test_lstm = np.append(x_test_lstm, pred, axis=0)
89
+ x_test_lstm = x_test_lstm[1:]
90
 
91
+ predictions = np.array(predictions)
92
  next_month_predictions = scaler.inverse_transform(predictions)
93
  next_month_price = next_month_predictions[-1][0]
94