Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question regarding predict_sequences_multiple function #2

Open
jesperbruunhansen opened this issue Feb 6, 2018 · 2 comments
Open

Comments

@jesperbruunhansen
Copy link

jesperbruunhansen commented Feb 6, 2018

I'm trying to understand your implementation of predict_sequences_multiple() and especially the way you insert your predictions to the current frame.

As I read your code, the prediction made from the current frame, gets inserted here replacing the last element of the curr_frame array, which makes sense since you are slowly using your previous predictions to make new predictions, and hereby create the ability to predict t+n, rather than t+1.

But I notice that you are inserting all 4 columns values with the predicted y-hat value (bitcoin prize)? (please correct me if I'm wrong about that).

This puzzles me, as I think it would confuse the model to mix the predicted bitcount prize with the 4 features of the dataset (Open, Close, Volume (BTC) and Volume (Currency)) - do you agree?

I've inspected the code several times with the debugger of pycharm, so I'm pretty sure that is what the code is doing, so I guess my question really is why that is the approach you have taken? I understand that the model.predict() method from Keras expects an array of the same shape as it was trained, and you achieve that by doing so, but is this approach "is the way to it", or am I wrong about something?

btw thanks for a great ressource about forecasting with t+n!

Jesper.

@xcottos
Copy link

xcottos commented Feb 19, 2018

Hi Jesper,

I'm a newbie for multidimensional LSTM networks but what I got is that the goal is looking for patterns in the variation of the Bitcoin price not only from one variable, the price, (or better from one window of values of that dimension) but using one window of values of more dimensions (in this case open, close etc) since there could be correlations between the price and also the variation of those variables

that's my understanding

hope that helps
Luca

@jesperbruunhansen
Copy link
Author

Hi @xcottos, yes your intuition is absolutely correct.

But the question I am raising to @jaungiers implementation is specifically here from L27 to L29 where he inserts the predicted values from the model and appends as both attributes and target values of curr_frame. I'm curious about this approach, as it seems odd to use the predicted bitcoin price as attributes for future predictions when the model originally was trained upon Open, Close etc.

Do you follow my logic?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants