Iterative Process
Developing an ML system is an iterative and, in most cases, never-ending process. Once a system is put into production, it’ll need to be continually monitored and updated.
Before deploying my first ML system, I thought the process would be linear and straightforward. I thought all I had to do was to collect data, train a model, deploy that model, and be done. However, I soon realized that the process looks more like a cycle with a lot of back and forth between different steps.
For example, here is one workflow that you might encounter when building an ML model to predict whether an ad should be shown when users enter a search query:
- Choose a metric to optimize. For example, you might want to optimize for impressions—the number of times an ad is shown.
- Collect data and obtain labels.
- Engineer features.
- Train models.
- During error analysis, you realize that errors are caused by the wrong labels, so you relabel the data.
- Train the model again.
- During error analysis, you realize that your model always predicts that an ad shouldn’t be shown, and the reason is because 99.99% of the data you have have NEGATIVE labels (ads that shouldn’t be shown). So you have to collect more data of ads that should be shown.
- Train the model again.
- The model performs well on your existing test data, which is by now two months old. However, it performs poorly on the data from yesterday. Your model is now stale, so you need to update it on more recent data.
- Train the model again.
- Deploy the model.
- The model seems to be performing well, but then the businesspeople come knocking on your door asking why the revenue is decreasing. It turns out the ads are being shown, but few people click on them. So you want to change your model to optimize for ad click-through rate instead.
- Go to step 1.
This shows an oversimplified representation of what the iterative process for developing ML systems in production looks like from the perspective of a data scientist or an ML engineer. This process looks different from the perspective of an ML platform engineer or a DevOps engineer, as they might not have as much context into model development and might spend a lot more time on setting up infrastructure.
Source
Designing Machine Learning Systems by Chip Huyen