Code Monkey home page Code Monkey logo

ml-spp's Introduction

ml-spp

This project explores a set of models for stock prices predictions. Repository implemented solutions aim to predict following stocks Adjusted Close value:

  • IBM
  • Apple
  • Amazon
  • Google

The project currently supports two different models for stock Adjusted Close price:

  • a Simple Moving Average and
  • a DeepAR model.

Most of the project could be run locally, but the DeepAR based model needs to be run in a SageMaker notebook instance. When run on SageMaker, in order to work, notebook has also to comply the following prerequisites:

  • conda_pytorch_p36 kernel (although it could probably run on other kernels that supports pandas too)
  • a lifecycle configuration which includes a start script to install following prerequisites packages:
    • yfinance
    • scikit-learn

The project contains a web application to interrogate SageMaker define endpoint. The web application is based on Flask framework and interrogates the endpoint through a REST API, defined by means of AWS API Gateway. The AWS API Gateway interrogated the endpoint through an AWS Lambda function. For more details, look ad the ProjectReport.pdf

Project files and folder

Here follows project structure:

License file

Currently, under MIT license.
LICENSE

Project report

ProjectReport.pdf

Jupyter Notebooks

0.DataGathering.ipynb
1.ExploratoryDataAnalysis.ipynb
2.BenchmarkModel.ipynb
3.DeepAR-StockPricesPredictions.ipynb (relies on AWS SageMaker DeepAR implementation)

The notebooks should be run in sequence:

  1. 1.ExploratoryDataAnalysis should be run re-using the kernel from 0.DataGathering
  2. 2.BenchmarkModel should be run re-using the kernel from 1.ExploratoryDataAnalysis
  3. 3.DeepAR-StockPricesPredictions should be run re-using the kernel from 2.BenchmarkModel

AWS SageMaker notebook instance lifecycle script

on_start.sh

DeepAR model related code

This folder has been created to host files needed to interface with SageMaeker DeepAR model, and to plot results from there.
source_deepar/deepar_utils.py
source_deepar/display_quantiles.py
source_deepar/lambda_stock_prediction.py

Pytorch model related code

This folder has been created to host files of a future Pytorch based prediction implementation. This is a very interesting future development thread. Any help would be welcome.
source_pytorch/model.py

Utility code

This folder contains a few scripts to manage and prepare data for model preprocessing. It currently contains:

Web application code

This folder contains the implementation of a Flask and JavaScript based web app to interrogate model endpoint.
This part of the project has been just sketched for quick presentation purposes but could be an interesting future development thread. Any help would be welcome.
website/static/formControl.js
website/static/sbtStockPredReq.js
website/templates/base.html
website/app.py

ml-spp's People

Contributors

alfreedolf avatar

Watchers

 avatar

Forkers

tezheng

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.