Databricks shows how Genie Code takes an ML notebook to a serving endpoint

Databricks shows how Genie Code connects MLflow experiments, reusable features and weekly retraining, and where teams can add a model promotion gate.

Editorial cover: DatabricksEditorial cover: Databricks
Company marks identify their owners. Reference only; no endorsement.

Databricks published a walkthrough on December 3 showing how ML engineers can use Genie Code to turn a single training notebook into a versioned model served over REST, with a scheduled retraining job and a monitoring example. The companion notebook exposes the label and feature choices, MLflow records the experiments, and a Declarative Automation Bundle defines the order in which feature engineering, training and deployment run. The sample’s weekly job can redeploy a model without comparing it with the version already serving. Databricks walkthrough

A proposed workflow runs scheduled training, compares the candidate with the champion and deploys only after approval. A failed review keeps the current champion.A proposed workflow runs scheduled training, compares the candidate with the champion and deploys only after approval. A failed review keeps the current champion.
A proposed addition to the Databricks example puts an evaluation and approval step between scheduled retraining and deployment.

Databricks blog page titled Build end-to-end ML workflows with Genie Code.
Databricks’ blog page for its Genie Code machine learning walkthrough. · Original source

Check when each feature becomes available

The example starts with a single quarter of Lending Club originations. The notebook excludes loans marked Current or In Grace Period and treats charged-off loans and both late categories as positive examples. The classifier’s positive class therefore includes delinquency as defined by the sample. An engineer adapting it should first specify which event counts as positive and how long a loan must be observed before assigning a label. Companion training notebook

The notebook also drops fields such as total_pymnt and recoveries, which describe events after origination. The same timing check applies to fields the model keeps. Databricks reports that interest rate and loan grade rank among the most influential features in its explanation analysis. If a team wants a score before its own underwriting process assigns a grade or sets a rate, it should check the provenance and availability of both inputs at that specific decision point. The example uses a random stratified split on one quarter of originations. A team with a longer history can use later cohorts to test how well its model carries forward. Databricks walkthrough · Databricks ML lifecycle guide

Review the metrics before wiring up deployment

Databricks reports the following test results for its initial random forest and tuned gradient boosting model. Recall rose from 0.0443 to 0.6215, meaning the tuned model flagged a larger share of the positive examples. ROC AUC rose from 0.7074 to 0.7212, and F1 rose from 0.0831 to 0.4685. Databricks describes the drop in precision qualitatively. The comparison changes both the model family and its tuning. A team choosing a decision threshold should review false positives and missed positives on its own evaluation cohort. Databricks walkthrough

The walkthrough puts feature computation in a shared function, registers feature definitions in Unity Catalog and uses a separate notebook to send sample requests to the live endpoint. A practical staging check is to take a few records through both the training and serving paths and compare the resulting feature values, including missing values and units. Keep the model version and MLflow run ID with the results so a reviewer can trace the endpoint responses back to the evaluated artifact. Databricks walkthrough · Databricks ML lifecycle guide

Make promotion a separate decision from retraining

The sample bundle schedules feature engineering, training and deployment in sequence. Databricks calls out the missing promotion gate in the walkthrough. Teams adapting the job can insert a step after training that evaluates the candidate and the current champion on the same held-out cohort. Record both model versions, the evaluation window and the pass criteria. Require the candidate to meet those criteria and obtain sign-off before deploying that specific version. If the review fails, keep the current champion serving. Databricks walkthrough · Databricks ML lifecycle guide · Automater’s guide to model promotion evidence

Once the endpoint is serving, operators can use logged requests and responses to track shifts in inputs and predictions. Measuring accuracy requires joining those predictions to actual outcomes as they arrive. Databricks uses synthetic timestamps to simulate a week of inference traffic in the monitoring example. In a lending workflow, operators can investigate drift as soon as it appears and evaluate prediction quality once the matching outcomes are available. They can use that later evaluation to inform the next promotion review. Databricks walkthrough · Databricks ML lifecycle guide

Sources

  1. Build end-to-end ML workflows with Genie Code | Databricks Blog
  2. ml-crawl-walk-run-with-genie-code/src/crawl/lending_club_crawl.py at master · mpkrass7/ml-crawl-walk-run-with-genie-code · GitHub
  3. Machine learning lifecycle | Databricks on Google Cloud