Bitzu

Machine Learning Associate ยท MLflow tracking and the model registry

Deploy code vs deploy models

Deploy-code versus deploy-models patterns across environments, and the scenarios where each is preferred (training in prod on prod data vs training once and promoting the artifact).

Key points

  • Deploy code: the same training code is promoted dev, staging, prod; the model is trained in each environment.
  • Fits restricted prod data and reviewed automated retraining.
  • Deploy models: train once in dev, then promote the model artifact.
  • Fits very expensive or hard-to-reproduce training; retraining automation and supporting pipelines need extra care.
  • Databricks recommends deploy code in most situations.

Source: https://docs.databricks.com/aws/en/machine-learning/mlops/deployment-patterns

Practice questions

Single choice

In the deploy-code pattern, what moves between environments?

  1. Only the trained model artifact
  2. The training code, which then runs in each environment
  3. Only the raw data copies
  4. Only the cluster configuration
Show answer

Answer: B. The training code, which then runs in each environment

Deploy code promotes the training code (and pipelines), and the model is trained in each environment. Promoting the trained artifact is the deploy-models pattern.

Select all that apply

Which are advantages of the deploy-code pattern?

  1. Works when access to production data is restricted
  2. Automated retraining runs reviewed, approved code
  3. The model is trained only once
  4. Supporting pipelines travel with the code through environments
  5. No CI/CD or repos are needed
Show answer

Answer: A. Works when access to production data is restricted, B. Automated retraining runs reviewed, approved code, D. Supporting pipelines travel with the code through environments

Deploy code works when prod data is restricted and makes automated retraining safer because code is reviewed. Training only once is a deploy-models trait.

True or false

Deploy-models is the pattern Databricks recommends in most situations.

Show answer

Answer: False

False. Databricks recommends deploy code in most situations; deploy models suits cases such as very expensive training.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More Machine Learning Associate topics in this module