Code Monkey home page Code Monkey logo

hands-on-train-and-deploy-ml's Introduction

Hands-on MLOps

Train and Deploy a Real-Time ML model

to predict crypto prices

CometML + Cerebrium = ๐Ÿš€

Contents

The problem

Predicting crypto price movements is extremely hard. But it is also a great field to show what Machine Learning has to offer.

In this tutorial you won't build an ML system that will make you rich. But you will master the MLOps frameworks and tools you need to build ML systems that, together with tons of experimentation, can take you there.

With this hands-on tutorial, I want to help you grow as an ML engineer and go beyond notebooks.


This is what you will learn

You will learn to

  • train an ML model prototype through careful experimentation, using CometML.
  • deploy the model as a REST API, with Cerebrium.
  • automate safe deployments, using GitHub actions and Comet ML Model Registry.

Without further ado, let's get to work!


Run the whole thing in 5 minutes

If you only have 5 minutes and want to see the whole system in action, follow these steps:

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

    $ make init
    
  2. Set your API keys for Comet ML and Cerebrium in set_environment_variables_template.sh, rename the file as set_environment_variables.sh and run it

    $ . ./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. Take the endpoint URL you get from Cerebrium in the previous step, and set the CEREBRIUM_ENDPOINT_URL variable in set_environment_variables.sh. Then re-run

    $ . ./set_environment_variables.sh
    
  7. Test the endpoint works

    $ make test-endpoint
    

Lectures

1. Model training

In this first lecture you will

  • fetch raw data
  • transform it into features and targets
  • build a baseline model
  • experiment with several ML models in a fast and reliable way, using Python scripts and Comet ML experiment tracking

In this lecture you won't train an ML model that will make you rich. But you will master the framework and skillset you need if you want to build ML models that, together with tons of experimentation, can take you there.

Ready to get your hands-dirty? Start training models ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป ๐Ÿ‹๏ธ


2. Model deployment as REST API

In this second lecture you will

  • deploy the best ML model you found in lecture 1 as a REST API using Cerebrium

  • test the endpoint works.

Ready to deploy? Start deploying models ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป ๐Ÿš€


3. Automatic deployments with GitHub actions and Model Registry webhooks

ML models often need to be re-trained to keep them performant. Hence, automating safe deployments is a must.

In this third and final lecture you will

  • build a continuous deployment pipeline using GitHub actions
  • create a webhook to trigger deployments from the Model Registry.

Ready for the final round? Start automating safe deployments ๐Ÿ‘ฉโ€๐Ÿ’ป๐Ÿ‘จ๐Ÿฝโ€๐Ÿ’ป ๐Ÿช


Wanna learn more Real-Time ML?

Wanna learn to build a complete ML system that

  • ingests real-time crypto data
  • trains predictive ML models, and
  • continuously deploys them

using MLOps best practices?

I am preparing a new hands-on tutorial where you will learn all this.

Subscribe to The Real-World ML Newsletter to be notified when the tutorial is out.

Let's connect ๐Ÿค—
Twitter โ€ข LinkedIn โ€ข Newsletter

hands-on-train-and-deploy-ml's People

Contributors

paulescu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.