Skip to main content

Modular Neural Network Protyping for Stock Market Prediction

Project description

StockerMake: Modular Prototyping Tool for Stock Market Prediction Models

Installation

Install using pip installer.

pip install stockermake

Usage

The StockerMake Script

The StockerMake script combines the Stocker and helper modules into one to create an easy, convenient, and modular neural network prototyping tool designed for stock market prediction. The script will take the user's desired parameters and create, train, and evaluate a model fitting said parameters. This allows the user to quickly analyze model prototypes, make adjustments, and iterate on model designs.

Arguments:

Positional:
    key ---- User's Alpha_Vantage API key
    symbols ---- Ticker symbols to create models for

Optional:
    depth ---- number of layers to include in the neural network (def: 1)
    node_counts ---- list of node counts for layers (len(node_counts) must equal depth)
    batch ---- batch size of input data set (def: [100])
    test_size ---- proportion of dataset to use as validation (def: .2)
    loss ---- identifier string of keras-supported loss function to be used in training (def: mse)
    learning_rate ---- learning rate to be used by the Adam optimizer
    epochs ---- maximum number of epochs to train the model (def: 100)
    model_in ---- file path of pre-made model to load
    early_stop ---- flag deciding whether to apply early stopping (patience 5) to the training phase
    plots ---- flag deciding whether to save loss, input, and prediction graphs

Usage Example:

StockerMake APIKEY FORD MSFT --early_stop --plots

The Stocker Module

If you would like to use your own data pipelines as inputs, the Stocker and data helper modules can be used separately from the main script.

from Stocker import *

""" Data operations (assign data, pred_data)
______________________________________________
"""

stkr = Stocker('FORD', data)
stkr.train(25, True, True))
stkr.evaluate()
stkr.save_model('./models/')
stkr.predict_data(pred_data)

The above code will take prepared data, create a stocker instance for the FORD ticker, train for 25 epochs, save the model to the models folder as FORD.h5 and predict a data point based on the user's prepared prediction data.

The Helpers module

This module includes the data operation helper functions used by Stocker.

daily_adjusted() returns a pandas dataframe of historical daily adjusted stock data.

single_step_data takes a full dataset and creates a single-step timeseries dataset from it for input into an LSTM model.

make_dir() is a filepath helper to assist with saving models.

Coming soon!

Stocker:

  • Support for more layer types
  • Multi-step future models
  • Optimizer customization
  • Customizable past-window (how far back to consider)

Helpers:

  • Data for multi-step prediction
  • Data normalization option
  • Compact (last 60) data

Contributions

Please send pull requests! I am a full-time student, so development and support for Stocker will likely be slow with me working alone. I welcome any and all efforts to contribute!

License

GNU LGPLv3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

StockerMake-0.0.12.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

StockerMake-0.0.12-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file StockerMake-0.0.12.tar.gz.

File metadata

  • Download URL: StockerMake-0.0.12.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

File hashes

Hashes for StockerMake-0.0.12.tar.gz
Algorithm Hash digest
SHA256 e2eeb48c325fcc441eda76259b994e748e5e6a45762acf10af5b52e47da998a0
MD5 86a2c0d24e100622b46091bfee5d9f90
BLAKE2b-256 8d6da5f99a9baf9a30fac2383f6c27ac03afe6247fd7e612d27b84bab3078342

See more details on using hashes here.

File details

Details for the file StockerMake-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: StockerMake-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.6.9

File hashes

Hashes for StockerMake-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 38c272323f63d690f008f416fca4194b96bf179dd0fe24a2ea040a4f91d569aa
MD5 ec697dd1ba611df745bd861680c43f91
BLAKE2b-256 3b9a16ff7c54c3c892eea11462e67ba410bbddb8d54acdd944c62f15e9e40fe7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page