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

prediction always 0 #3

Open
deanshub opened this issue Jun 10, 2017 · 14 comments
Open

prediction always 0 #3

deanshub opened this issue Jun 10, 2017 · 14 comments

Comments

@deanshub
Copy link

Hi,
Iv'e altered your code to support google API instead of yahoo which stopped working
but the prediction seems to always return 0, even the acc prints always 0,
can you please explain why?

@zhivko
Copy link

zhivko commented Jun 19, 2017

Exactly, I did same (changed google for yahoo to retrieve data), and this is what I get:
It would be nice if you could comment how to fix this.
tf
You can check my source code under:
https://github.com/zhivko/lstm_stock_prediction/blob/master/.ipynb_checkpoints/predict.py

@etai83
Copy link
Owner

etai83 commented Jun 19, 2017

Hi guys!
try to do the following:

  1. change the stock value in the df object to contain 0.3 values (divide it by 1000 instead of 100).
  2. try to minimize the window parameter value from 22 to 5.

This will help the model to train more efficiently.

@etai83 etai83 closed this as completed Jun 19, 2017
@etai83 etai83 reopened this Jun 19, 2017
@etai83
Copy link
Owner

etai83 commented Jun 19, 2017

tell me how it worked

@zhivko
Copy link

zhivko commented Jun 20, 2017

Tried changes you suggested - but result it same (same graph as above), however I can see from output minimizing is happening. Check output from https://pastebin.com/AXXiBX41
Maybe problem is just in charting?
Check updated code at:
https://github.com/zhivko/lstm_stock_prediction/blob/master/.ipynb_checkpoints/predict.py

@etai83
Copy link
Owner

etai83 commented Jun 20, 2017

Your submitted code does not contain my first suggestion. Try to divide the Close, Volume, High by 1000.

@zhivko
Copy link

zhivko commented Jun 20, 2017

Oh - that's better.
works
I pushed the code to my repo.

@zyf3883310
Copy link

this paper I saw, but this solution is still not possible

@zyf3883310
Copy link

so, can you provide a good solution

@zyf3883310
Copy link

or is the stock model not good?

@etai83
Copy link
Owner

etai83 commented Jul 12, 2017

Try to run the code's latest version. I've uploaded one yesterday.

@zyf3883310
Copy link

hello why this input . such as stock high,open,close must divide 1000?

@and-rewsmith
Copy link

and-rewsmith commented Aug 11, 2017

Why are you dividing close/high/output by 1000? Mine flatlines if I don't divide but I don't understand why. I've tried scaling and using leaky-relu instead of relu but that did not fix it. Any reasoning behind that?

@etai83
Copy link
Owner

etai83 commented Aug 11, 2017

In this example dividing by 1000, we are helping the algorithm to learn more efficiently and get better results much faster.

@and-rewsmith
Copy link

Why does that help the learning efficiency?

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

5 participants