Skip to main content

MLProto: Modular Prototyping Tool for LSTM Machine Learning Models

Usage

Video overview coming

The ProtoMake Script

The ProtoMake script combines the Proto and Data modules into one to create an easy, convenient, and modular neural network prototyping tool for LSTM machine learning models. 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
    identifier ---- Ticker symbols to create models for
    target ---- Column number of target values

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
    --normalize ---- flag deciding whether or not to normalize input data

Usage Example

ProtoMake test.csv test_model --early_stop --plots

The above command will create, train, and evaluate a model for the data in test.csv. It saves a model test_model.h5 in directory ./models/ and input, loss, and prediction graphs in the directory ./plots/ for analysis.

The Proto Module

The Proto module contains the core functionality of the machine-learning portion of the package. It holds all of the model manipulation methods.

``` Python
from MLProto import *

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

stkr = Proto('test', data)
stkr.train(25, True, True))
stkr.evaluate()
stkr.predict_data(pred_data)
```

The above code will take prepared data, create a Proto instance "test" for the data given, train for 25 epochs, save the model to the models folder as train.h5 and predict data points based on the user's prepared prediction data.

The Data module

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

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

Contributions

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

License

GNU LGPLv3

Release files for MLProto 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for MLProto 0.2.0
File Size Uploaded
MLProto-0.2.0.tar.gz 7.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for MLProto 0.2.0
File Interpreter ABI Platform
MLProto-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / MLProto-0.2.0.tar.gz

Download URL MLProto-0.2.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8e5f0c0f73a68e91aed1638905ee2d21293f41761558ead4b1171b8a1eb3f5c8
BLAKE2b-256 checksum
How to use checksums
004c25ce17b9df87d0ad5b8cb6ee919edd8c1a9ffa705851d1cf1cc7026dd8f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

Release files / MLProto-0.2.0-py3-none-any.whl

Download URL MLProto-0.2.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cbc8f6f4587111ca5a2bfc0a81edcda9c972b9d0db4ecfcef659cad3285e4dd
BLAKE2b-256 checksum
How to use checksums
13ec2b429072db2c0fc2657e40e9f65b258252987f0cc84527e0b9997373696b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.31

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page