Sign inSign up

tomsriddle/time-series-forecasting

By tomsriddle

•Updated over 2 years ago

Portfolio project demonstrating how to provide a Time Series Forecasting service

Image
0

90

tomsriddle/time-series-forecasting repository overview

⁠Time Series Forecasting

⁠Overview

This repository provides a sample implementation of an end to end service that can predict total and fraudulent transactions given a date.

⁠Local Development Environment used for running image

  • Apple Mac M1 chip
  • Sonoma 14.1.2
  • Docker Desktop for Mac 4.26.1 (131620)

⁠Training Data

⁠Docker

⁠Pull Image

To pull an image use the following

docker pull tomsriddle/time-series-forecasting:1.0

After pulling the image check that it is present using following

docker image ls

⁠Run Image

To run the image use following

docker run -p <host port>:8786 -v <host path>:/workspace/shared-data -e data-folder=/workspace/shared-data/ -e training-data-file=CreditCardFraudFourYears.csv "tomsriddle/time-series-forecasting:1.0" 

Note: See the volume mapping - this is needed for the data-folder where things like transformed_data.csv is stored. Similarly see the use of the 2 environment variables

⁠Docker Run Example

Image Not Showing

⁠API Usage

Following APIs exposed

⁠Forecast

This provides prediction whether the given transaction is fraudulent or not.

POST http://localhost:8788/fraud-forecast

Request Body (all attributes are mandatory)
--------------------------------------------------------
{
    "forecast_date": "2023-11-28"
}

Response Body
--------------------------------------------------------

{
    "fraudulent_transactions": 33.09457837755995,
    "total_transactions": 16424.66484448641
}

Image Not Showing

⁠Model Evaluation

We have tried the following models

  • SARIMAX:Low RMSE for Total Transactions but higher for Fraudulent
  • Prophet:Provided the same RMSE as SARIMAX but performed faster
  • LSTM (PyTorch): Provided the lowest RMSE for Total Transactions

⁠Troubleshooting

  • As a part of running from local or through docker image, we have to pass arguments for the folder where the training data is.

Tag summary

Content type

Image

Digest

sha256:c81f3bb60…

Size

639.9 MB

Last updated

over 2 years ago

docker pull tomsriddle/time-series-forecasting:1.0