• Home
  • About
    • Thibault Dody photo

      Thibault Dody

      Personal articles and projects related to Data Science.

    • Learn More
    • LinkedIn
    • Github
  • Posts
    • All Posts
    • All Tags
  • Projects

Revenue Prediction (Deployed)

03 May 2020

Reading time ~1 minute

Created by Thibault Dody, 05/03/2020.

Revenue Prediction

Goal

The available dataset consists of a set of json files. Each json file contains the monthly transaction of our company.
The objective is to predict the total revenue generated during the 30 days following an input date.

The focus on this project is to develop and efficient and useful workflow. The project stats with an EDA, different models are then tested.

My main objective through this project was to build and deploy a model and an associated API.
The python code is available in my Github repository.

For the deployment of this model, I have chosen the following:

  1. Build a flask app to create a web interface.
  2. Build a Docker container for future use.
  3. Deploy a live version using Heroku

A live version can be accessed here

Note: The loading of the app can take a few seconds if Heroku needs to restart the build.

API

Prediction

Two inputs are used for the prediction:

  1. A country (if all is used then the predicted revenue encompasses all markets).
  2. A date for which to compute our future revenue.

Training

The API allows the user to re-train a model for a specific country. This useful feature can help keep the model up to date with new data.

Training model API

Logs

In order to monitor our model performance and trainings, two logs are kept up-to-date every time our models are trained or used for prediction.

Logs API


DockerHerokupython Share Tweet