sebastianheinz / stockprediction Goto Github PK
View Code? Open in Web Editor NEWData and code of my Medium story on stock prediction with TensorFlow
Data and code of my Medium story on stock prediction with TensorFlow
Hi,
the Epoch charts are not updating when I run this code. Any insight on why that me be?
Thanks
I have run into two issues with line 59.
When run as shown, I get:
AttributeError: module 'tensorflow' has no attribute 'variance_scaling_initializer'
If I change the line to read
weight_initializer = tf.contrib.layers.variance_scaling_initializer(mode="fan_avg", distribution="uniform", scale=sigma)
I then get this error:
TypeError: variance_scaling_initializer() got an unexpected keyword argument 'distribution'
I only installed TensorFlow last week, and your file is only 23 days old, so I doubt that we have a version issue. Do these errors mean anything to you?
When i run the code, the following error is shown
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pydev\pydev_run_in_console.py", line 53, in run_file
pydev_imports.execfile(file, globals, locals) # execute the script
File "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "C:/Users/User/PycharmProjects/summer_work/stock_ann.py", line 97, in
fig = plt.figure()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\pyplot.py", line 557, in figure
draw_if_interactive()
File "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 39, in draw_if_interactive
figManager.canvas.show()
File "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 62, in show
self.figure.tight_layout()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\figure.py", line 1753, in tight_layout
rect=rect)
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\tight_layout.py", line 326, in get_tight_layout_figure
max_nrows = max(nrows_list)
ValueError: max() arg is an empty sequence
Traceback (most recent call last):
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\IPython\core\events.py", line 73, in trigger
func(*args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\pyplot.py", line 149, in post_execute
draw_all()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib_pylab_helpers.py", line 150, in draw_all
f_mgr.canvas.draw_idle()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\backend_bases.py", line 2040, in draw_idle
self.draw(*args, **kwargs)
File "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 94, in draw
self.show()
File "C:\Program Files\JetBrains\PyCharm 2017.3.2\helpers\pycharm_matplotlib_backend\backend_interagg.py", line 62, in show
self.figure.tight_layout()
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\figure.py", line 1753, in tight_layout
rect=rect)
PyDev console: using IPython 6.2.1
File "C:\Users\User\AppData\Local\Programs\Python\Python35\lib\site-packages\matplotlib\tight_layout.py", line 326, in get_tight_layout_figure
max_nrows = max(nrows_list)
ValueError: max() arg is an empty sequence
In your implementation, you are retaining your model with test data! This should be strictly forbidden in any ML practice!
Where is the original code at the end of the file?
This should not be an example of using historical stock data to predict future stock data, right? It seems more like directly training and fitting stocks that appear through various variables?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.