deeplearning

deeplearning / TensorflowLSTM / 0.1.1

README.md

Introduction

This is a simple LSTM based time-series predictor written with Tensorflow.

Input

  • ​(Required): historical_data (csv file, with at least a single column with time-series data)
  • (Optional): training_steps (default=100)
  • (Optional): time_step (default=1)
  • (Optional): batch_size (default=100)
  • (Optional): num_rnn_layers (default=5)
  • (Optional): column_name (required if you have multiple columns in csv file)

Output

  • ​Predicted time-series
  • Mean Absolute Error (MAE)
  • Mean Squared Error (MSE)

Example(s)

​Example 1.

  • ​Param 1: Time-series csv dataset
  • Param 2: Column name of where time-series values reside
{
  "historical_data": "data://deeplearning/TensorflowLSTM/housing_time_series.csv",
  "column_name": "value"
}

Output:

{
  "MAE": 207.96009826660156,
  "MSE": 43307.59374999999,
  "prediction": [26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766,26.22489166259766]
}

Example 2.

  • ​Param 1: Time-series csv dataset
  • Param 2: Larger training step
  • Param 3: Increase rnn layer size
{
  "historical_data": "data://deeplearning/TensorflowLSTM/housing_time_series.csv",
  "column_name": "value",
  "training_steps": 500,
  "num_rnn_layers": 10
}

Output:

{
  "MAE": 206.6985778808594,
  "MSE": 42784.49218749999,
  "prediction":   [27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172,27.486431121826172]
}

Credit(s)

Code based on tgjeon/TensorFlow-Tutorials-for-Time-Series and pusj/LSTM-Time-Series-Analysis-using-Tensorflow on Github.
Description image taken from Wikipedia Commons.
Datasets retrieved from data.gov