Coder Social home page Coder Social logo

diegslva / neural-network-stock-predictor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jakemmarsh/neural-network-stock-predictor

0.0 2.0 0.0 320 KB

Semester project for COS 470 (Artifical Intelligence) at the University of Maine.

License: MIT License

Python 44.51% JavaScript 42.26% HTML 13.23%

neural-network-stock-predictor's Introduction

neural-network-stock-predictor

Semester project for COS 470 (Artifical Intelligence) at the University of Maine.

This is an application that utilizes the power of back-propagating neural networks in order to attempt to predict future stock prices of a specified stock symbol. Although the power and accuracy of neural networks are based upon the input and training you provide it, they would not usually be the best option for attempting to predict stock prices as we're doing here.


Analytical Approach

If you're not familiar with a neural network, an incredibly basic rundown of how they operate is this:

  • You provide them with a list of input nodes and corresponding output node(s), allowing them to 'learn' any patterns
  • Adaptive weights and approximations are used and tuned in this learning process
  • Once trained, the neural network can be provided with input nodes and return its predicted output node(s) following the learned pattern

In this program, a stock symbol (such as GOOG) is provided to the program via the Flask-powered API. This is then used to retrieve historical stock prices for that symbol, via Kibot's API. These are then used to retrieve three values for five different days:

  • Rolling average
  • Rolling maximum
  • Rolling minimum

These are paired with the normalized stock price for one of the five days, normalized using the following function:

((2*price - (maximum + minimum)) / (maximum - minimum))

After this work is done, the neural network receives a list of five nodes of the format: [[average, maximum, minimum], normalized price] for training. Once trained, all we have to provide in the future is [average, maximum, minimum] in order to be returned a predicted normalized price. This number is then roughly denormalized using the reverse of the above function, and returned from the API.


Libraries Used

The backend of this application is written in Python, utilizing the Flask framework to create an API.

The frontend of this application is written in Javascript, utilizing the following libraries:


How To Run

In order for the backend to function, the previously mentioned Python framework must be installed. This can be installed using pip with the following command:

  • pip install Flask

For the frontend, no installation is necessary. However, in order to utilize the supplied Grunt tasks for minification and compilation, npm must be installed to run the following command:

  • npm install

In order to then run the program, execute npm start. This will compile and serve the application at the URL specified.

neural-network-stock-predictor's People

Contributors

jakemmarsh avatar

Watchers

Diego S avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.