Skip to content

Instantly share code, notes, and snippets.

@under0tech
Created September 16, 2022 19:05
Show Gist options
  • Save under0tech/2af80e3dc609d1f5a0a6de99ce35fd83 to your computer and use it in GitHub Desktop.
Save under0tech/2af80e3dc609d1f5a0a6de99ce35fd83 to your computer and use it in GitHub Desktop.
# GET PREDICTIONS
predictions = []
for step in LOOKUP_STEPS:
df, last_sequence, x_train, y_train = PrepareData(step)
x_train = x_train[:, :, :len(['close'])].astype(np.float32)
model = GetTrainedModel(x_train, y_train)
last_sequence = last_sequence[-N_STEPS:]
last_sequence = np.expand_dims(last_sequence, axis=0)
prediction = model.predict(last_sequence)
predicted_price = scaler.inverse_transform(prediction)[0][0]
predictions.append(round(float(predicted_price), 2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment