Coder Social home page Coder Social logo

asdlei99 / rnn-to-predict-google-stock-prices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from neeru1207/rnn-to-predict-google-stock-prices

0.0 1.0 0.0 52 KB

RNN using LSTM layers in coded in Python using Keras to predict Google open stock prices.

Python 100.00%

rnn-to-predict-google-stock-prices's Introduction

RNN to predict Google Stock Prices

A Recurrent Neural Network coded in Python using Tensorflow's Keras to try to predict Google Stock prices.

Installation

  • Download and install Python3 from here

  • I recommend using virtualenv to create a Python environment. It's good practise to create and use different environments for different projects. Open a terminal and type:

    pip install virtualenv
  • Create a Virtual environment with some name say rnnenv.

    • Windows
    virtualenv rnnenv
    cd rnnenv/Scripts
    activate
    • Linux:
    source rnnenv/bin/activate
  • Clone this repository, extract it if you downloaded a .zip or .tar file and cd into the cloned repository.

    • For Example:
    cd A:\RNN-to-predict-Google-Stock-Prices-master
  • Install the required packages by typing:

    pip install tensorflow==1.15
    pip install pandas
    pip install matplotlib
    pip install numpy
    pip install scipy
    pip install -U scikit-learn

Running

python rnn.py

Dataset

The dataset contains high, low, close and open values of Google's stock prices, date and the volume. I tried to predict the open values based on past open values

Architecture

The architecture of the RNN is 4 sets of LSTM (Long short term memory) layers and Dropout regularization layers with the LSTM and Dropout layers sandwitched between each other. The number of time steps chosen for the RNN is 60. The model is trained on 100 epochs with a batch size of 32. The optimizer used is adam and the loss function is mean squared error.

Results

After successful prediction, the results were visualized using the matplotlib library.

rnn-to-predict-google-stock-prices's People

Contributors

neeru1207 avatar

Watchers

 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.