Professional Machine Learning Engineer
Determining an appropriate retraining policy involves creating a plan for when and how to update a machine learning model with new data. This is necessary because a model's performance can degrade over time as the data it encounters in the real world changes, a problem known as concept drift or data drift. A good policy balances the cost of retraining with the need to maintain model accuracy, and it can be triggered by different conditions. Common triggers include a schedule, such as retraining weekly or monthly, or a performance-based rule, such as retraining when the model's prediction accuracy drops below a defined threshold. The chosen policy directly impacts the automation pipeline, dictating how often it runs and what data it uses.
Deploying models in CI/CD/CT pipelines automates the process of testing, packaging, and releasing new model versions, and it extends the concept to include automated retraining. A continuous integration (CI) pipeline automatically tests new model code whenever a change is made to the source repository. Continuous delivery (CD) automates the steps to deploy a successfully tested model to a staging environment, and continuous training (CT) adds the automated retraining of the model itself using fresh data according to the retraining policy. On Google Cloud, Cloud Build is a key service for orchestrating these pipelines; it executes a series of defined steps, such as running unit tests, containerizing the model with Cloud Buildpacks, and pushing the resulting model artifact to Artifact Registry. The final step in the pipeline is often deploying the new model version to a serving platform like Vertex AI, which can then perform a canary or A/B test before fully replacing the old version.
Prepare and test your skills
Prepare and test your skills
Continuous integration (CI) automatically tests new model code when changes are made to the source repository, continuous delivery (CD) automates deploying a successfully tested model to a staging environment, and continuous training (CT) automatically retrains the model with fresh data according to a retraining policy. Together, these practices automate the entire lifecycle of testing, packaging, releasing, and retraining model versions.
Automated model retraining can be initiated by schedule-based triggers or performance-based triggers. Schedule-based policies retrain models at fixed intervals such as weekly or monthly, while performance-based rules trigger retraining when prediction accuracy drops below a specified threshold due to concept drift or data drift.
Cloud Build executes a defined sequence of pipeline steps, which includes running unit tests, containerizing model code using Cloud Buildpacks, and storing model artifacts in Artifact Registry. It then coordinates deployment to a serving platform like Vertex AI, which can run canary or A/B tests before fully replacing an earlier model version.