# Automate the model lifecycle

As with any modern software development process, we eliminate manual steps where possible, to reduce the likelihood of errors happening. For ML solutions we make sure there is a defined process for moving a model into production and refreshing as needed. (Note that we do not apply this automation to the initial development and prototyping of the algorithms as this is usually an exploratory and creative activity.)&#x20;

**For an algorithm which has been prototyped, and accepted into production the life-cycle is:**

* Ingest the latest data.&#x20;
* Create training and test sets.&#x20;
* Run the training.&#x20;
* Check performance meets the required standard.&#x20;
* Version and redeploy the model.

![](/files/XQh5gdQI5qbLPHCSuYzM)

In a fully automated lifecycle this process is repeated either on a schedule or triggered by the arrival of more recent data with no manual steps.

**There are a variety of tools and techniques to help with this. Some of the tools we have found useful include:**

* [MLFlow](https://mlflow.org/)
* AWS Sagemaker&#x20;
* GCP Vertex AI

## <mark style="color:blue;">**Experience report**</mark>

{% hint style="info" %}
*When creating a pricing estimation service for one of our clients we were working from a blank canvas in terms of ML architecture. We knew that the model was going to be consumed by a web application so we could deploy as a microservice, and that data came in weekly batches with no real-time need for training.*&#x20;

### <mark style="color:blue;">We took a lean approach using standard AWS services to create a platform able to ingest new data, retrain the model and serve the model as an API endpoint.</mark>&#x20;

*We used a combination of S3 with versioning as our model store, and S3 event notifications, Lambdas, Fargate and Amazon Load Balancer to automate the data ingest, provisioning and update of two models, using CloudWatch to log the operations. The process is fully automated and triggered by the arrival of a weekly data drop into an S3 bucket.*\
\
[<mark style="color:blue;">**Shaun McGee**</mark>](https://www.linkedin.com/in/shaunmcgee/)\ <mark style="color:blue;">**Product & delivery**</mark>

<mark style="color:blue;">Equal Experts, USA</mark>\
\
![](/files/VDZnzpIieDOWasj6lj5x)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://playbooks.equalexperts.com/mlops-playbook/practices/automate-the-model-lifecycle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
