Automated retraining and picking the best model
Databricks Machine Learning Professional · Lesson 17 of 22 · 2:05:47
YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗
Learning with these videos? Subscribe for new courses and exam-style questions.
Subscribe on YouTube (opens in a new tab)In this lesson
Prepare for the Databricks Certified Machine Learning Professional exam. In this lesson: what triggers retraining (a schedule, a table update, or an alert), wiring SQL alerts on metrics tables to jobs, choosing the best model on a metric fixed in advance, and the champion and challenger flow. Includes three original practice questions.
Study notes
The text of this lesson, to read at your own pace. Information as of November 2026.
A new country
Pebblecove's demand model was trained before a new country opened, and its errors climbed for a month before anyone noticed. Retraining by hand, when someone remembers, is too slow, and retraining blindly every night can replace a good model with a worse one. This lesson covers automated retraining, triggered by drift or by degraded performance, and a safe strategy to pick the model that serves next.
What triggers retraining
Retraining can start in three ways. A schedule retrains at a fixed rhythm, like every week, which is simple, but blind to what happens in between. A table update trigger on the job starts it when its source tables change, for example when a new month of labeled bookings lands, with no compute running while it waits. And an alert starts it when monitoring detects a problem: drift in the inputs or the predictions, or a drop in a quality metric once the labels arrive. Whatever the trigger, the reviewed and tested training code runs in production, as in the deploy code strategy.
Wiring alerts to jobs
Monitoring writes its results to metrics tables, so an alert is a Databricks SQL query on those tables, with a condition and a schedule. For example, the query reads the latest drift metric of the demand feature, and the condition fires when it crosses a threshold. The alert notifies people by email, Slack, or a webhook, and an alert can also run as a task of a job, so that the next task branches on its result, and starts retraining only when the condition is met. This keeps people informed, and lets the pipeline react without waiting for them.
Choosing the best model
Retraining produces a candidate, and the hard part is deciding whether it should replace the model in production. Fix the decision metric in advance, tied to the business goal, like the error on high season weeks, rather than whichever metric looks best afterwards. Evaluate the new model, the challenger, and the current champion on the same data: a recent hold out set that neither of them trained on. Promote the challenger only when it wins by a minimal threshold, and also passes the validation checks, like important slices and latency. Otherwise, the champion stays, and the run is logged, so the team can see why.
The champion and challenger flow
Here is the flow, as a job. The training task fits the challenger on fresh data, logs it to MLflow, and registers it as a new version in Unity Catalog. The evaluation task scores the challenger and the champion on the same hold out data, and stores both metrics. A condition task compares them with the threshold, and only when it passes does the deployment task move the champion alias, and reconfigure the serving endpoint. The registry keeps every version, so rolling back means pointing the champion alias at the previous one.
Recap
Let's recap. Retraining starts on a schedule, on a table update trigger, or on an alert from monitoring. Alerts are SQL queries on the metrics tables, with a threshold, and they notify people, or run as a task that leads to retraining. The decision metric is fixed in advance, and the challenger and the champion are compared on the same data. The challenger is promoted only when it wins by a minimal threshold, and passes validation. And every version stays registered, so the champion alias can roll back.
Quick checks for this lesson
The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.
Last month's labels land in a Delta table on a different day each month. Which trigger starts retraining as soon as they arrive, with no polling?
- A cron schedule on the first day of each month
- A notebook that checks the table every hour
- A table update trigger on the labels table
- An alert on the latency of the endpoint
Show the answer
A table update trigger on the labels table
A table update trigger runs the job when the labels table changes, whatever the day, with no compute running while it waits. “A cron schedule on the first day of each month” would run on a fixed day, which can come before the labels arrive. “A notebook that checks the table every hour” would keep compute busy, just to poll. And “An alert on the latency of the endpoint” would watch the speed of the endpoint, not the arrival of labels.
The challenger scored better on its own validation split, and the champion on its original test set. What is wrong with promoting the challenger?
- Nothing: a higher score is enough
- The comparison should use training data
- The champion must be kept for a year
- The scores come from different data
Show the answer
The scores come from different data
Two scores on different data cannot be compared, so both models must be evaluated on the same recent hold out set. “Nothing: a higher score is enough” would ignore that the test sets differ. “The comparison should use training data” would favor the model that memorized its own data. And “The champion must be kept for a year” is not a rule: the champion stays only while it wins.
The challenger wins by a tenth of a percent, below the minimal threshold of one percent. What should the pipeline do?
- Keep the champion, and log the result
- Promote the challenger, since it scored higher
- Delete the challenger version
- Retrain until the challenger wins
Show the answer
Keep the champion, and log the result
Below the threshold, the gain is within noise, so the champion stays, and the logged run explains the decision. “Promote the challenger, since it scored higher” would ignore the threshold that was fixed in advance. “Delete the challenger version” is wrong, since the version stays registered for audit. And “Retrain until the challenger wins” would tune until a result looks good, which overfits the decision.