NGYB / Stocks

Programs for stock prediction and evaluation
Apache License 2.0
346 stars 209 forks source link

StockPricePrediction_v2a_prophet.ipynb in [140] my predictions are not on val_size #5

Open kimalaacer opened 4 years ago

kimalaacer commented 4 years ago

Dear, I am following you directions. My data is 567 rows (train size = 400, Val_size=167, H=30) When I reach step 140 in your notebook, ,i get multiple errors, due to the predictions falling in H (after Train_val_size) and do not have corresponding actual data. another error I am getting is different dataframe size .

Compute error metrics

preds_list = forecast['yhat'][train_val_size:train_val_size+H] print("For forecast horizon %d, predicting on day %d, date %s, the RMSE is %f" % (H, i, df['date'][i-1]+ timedelta(days = 1), get_rmse(df[i:i+H]['y'], preds_list))) print("For forecast horizon %d, predicting on day %d, date %s, the mean MAPE is %f" % (H, i, df['date'][i-1]+ timedelta(days = 1), get_mape(df[i:i+H]['y'], preds_list))) print("For forecast horizon %d, predicting on day %d, date %s, the mean MAE is %f" % (H, i, df['date'][i-1]+ timedelta(days = 1), get_mae(df[i:i+H]['y'], preds_list)))

your graph is showing that your predictions are falling within your actual data, and you are fine tuning the parameters accordingly.

Should the preds_list=forecast['yhat'][train size:train_val_size]? Thank you for your time and consideration

NGYB commented 4 years ago

Not too sure what is the problem. Can you share what you tried to do and the error message you received.

jmathews2 commented 3 years ago

Thanks for sharing your code. I think the question above can be summed up by asking how you would best recommend updating this code to generate predictions BEYOND the current data set size, ie, predictions in the future?