Skip to content

Roh1702/hands-on-train-and-deploy-ml

Repository files navigation

A Hands-on Tutorial

Train and Deploy a real-time ML model

CometML + Cerebrium = 🚀


Contents

The problem

Training models inside notebooks is easy. Unfortunately, this is not enough when you want to build complete ML solutions for real-world problems.

In this hands-on tutorial you will learn how to

  • train an ML model that predicts crypto prices, and
  • deploy this model as a REST API

We will use Serverless ML tools to

  • track experiment runs and publish our best model to the registy, with CometML.
  • deploy the model as a REST API, with Cerebrium.

Without further ado, let's get to work!

Run the whole thing in 5 steps

  1. Create a Python virtual environment with all project dependencies with

    $ make init
    
  2. Set your API keys for CometML and Cerebrium as environment variables.

    $ . ./set_environment_variables.sh
    
  3. Download historical data from Coinbase and save it locally to disk

    $ make data
    
  4. Train ML model

    $ make train
    
  5. Deploy the model

    $ make deploy
    
  6. Test the endpoint works

    $ make test-endpoint
    

Lectures

1. Model training

2. Model deployment as REST API

3. Test API endpoint

4. Automation

Next steps

TODOs

  • Get data from Coinbase
  • Transform ts data into supervised ML data
  • Engineer a few features using technical indicators
  • Train a decent model with linear regression
  • Fix bug when computing tech indicators from raw prices
  • Deploy the modelLightGBMRegressor
  • Webhooks
    • Add secrets to GitHub
    • Trigger workflow from Comet ML model registry
  • Optimize model hyper-parameter with out-of-time cross validation use

About

Train an ML model to predict crypto prices and deploy it as a REST API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.6%
  • Makefile 3.1%
  • Shell 1.3%