
If you’re looking to elevate your MLOps projects to the next level, understanding its principles is an essential part of the process. In this article, we’ll offer an introduction to MLOps principles and elucidate the key concepts in an accessible manner. Each principle will receive a dedicated tutorial with practical examples in forthcoming articles. You can access all the examples on my Github profile. However, if you’re new to MLOps, I recommend starting with my beginner-friendly tutorial to get up to speed. So let’s dive in!
Not a Medium member? No worries! Continue reading with this friend link.
Table of contents:
· 1. Introduction · 2. MLOps principles · 3. Versioning · 4. Testing · 5. Automation · 6. Monitoring and tracking · 7. Reproducibility · 8. Conclusion
My MLOps tutorials:
- Tutorial 1: A Key Start to MLOps: Exploring Its Essential Components
- Tutorial 2: A Beginner-Friendly Introduction to MLOps Workflow
- Tutorial 3: Introduction to MLOps Principles
- Tutorial 4: Structuring Your Machine Learning Project with MLOps in Mind
- Tutorial 5: Version Controlling in Practice: Data, ML Model, and Code
- Tutorial 6: Testing in Practice: Code, Data and ML Model
- Tutorial 7: Tracking in Practice: Code, Data and ML Model
[I will be updating this list as I publish articles on the subject]
1. Introduction
In a previous article, we defined MLOps as a set of techniques and practices used to design, build, and deploy Machine Learning models in an efficient, optimized, and organized manner. One of the key steps in MLOps is to establish a workflow and maintain it over time.
The MLOps workflow outlines the steps to follow in order to develop, deploy, and maintain machine learning models. It includes the business problem that describes the problem in a structured way, data engineering that involves all the data preparation and preprocessing, machine learning model engineering that involves all the model processing from designing the model to its evaluation, and code engineering that involves serving the model. You can refer to the previous tutorial if you want more details.

All the parts of the workflow in Mlops are interconnected and run in a cyclic manner. At any point in the process, it may be necessary to revisit a previous step. This interdependence between the different stages of the workflow defines the MLOps lifecycle. The MLOps lifecycle is essential to ensure that the machine learning model is performing optimally and still addressing the business problem defined in the first stage. Therefore, it is crucial to maintain the MLOps lifecycle by adhering to the MLOps principles.
2. MLOps principles
The MLOps principles are a set of concepts that aim to maintain the MLOps lifecycle while reducing the time and cost of developing and deploying machine learning models, thus avoiding technical debt.
To ensure the maintenance of the entire lifecycle, the principles need to be applied across different workflow steps, including data, the Machine Learning model (ML model), and code. These principles encompass versioning, testing, automation, monitoring and tracking, and reproducibility. Successfully implementing these principles entails utilizing appropriate tools and following best practices such as project structuring.
In this article, I have attempted to prioritize the different principles based on their level of importance and the order in which they should be applied. However, it is important to note that all of these principles hold significance in mature machine learning projects: they are interdependent and complement each other.
3. Versioning

The first thing to consider in MLOps principles is versioning your different application components including data, ML model and code. It enables the tracking of changes made to the different MLOps components and reproducibility of the different steps of the workflow. It also allows developers and data scientists to roll back to a previous version if needed, compare performance between different versions, and reproduce results.
Versioning in data engineering, includes versioning the datasets, the features, the metadata and the processing pipelines. It can be managed using a version control system (VCS) such as Git and DVC (Data Version Control), which enables versioning and tracking of large data files.
Versioning the ML model includes versioning the model itself (its architecture and its weights) the the training pipeline, the hyperparameters and the results. It is generally managed using Git; however, other tools, like MLflow, exist for this task and provide additional functionalities such as versioning other metadata.
Versioning the code includes versioning the code source itself and its different configurations. It is also recommended to keep the libraries versions for each code versioning to prevent libraries version problems.
Overall, versioning is essential in MLOps to ensure that changes made to the machine learning model, code, and data are tracked and managed effectively.
4. Testing

Testing is an essential, crucial and mandatory aspect in MLOps. It reduces the risk of errors and bugs and enable to detect and fix the issues quickly. Furthermore, it guarantees that machine learning models are performing as intended and meeting the business problem requirements.
Data testing ensures the quality and the correctness of the data used for machine learning which in turn ensures the accuracy and reliability of machine learning models. It includes datasets validation and data processing pipeline validation. Datasets validation consists of identifying the potential issues in data such as missing values and inconsistent data. This latter is done by computing some statistics and visualization techniques. Data processing pipeline validation consists of unit testing the different data processing functions especially for features creation.
The ML model testing ensures accurate predictions on new data and assesses the model’s generalization capabilities. It is a process of testing, evaluating and validating the ML model. This process includes testing the model specification, the training pipeline integration and the model’s the relevance and correctness. In addition, some non-functional requirements like security, fairness, interpretability also need to be tested to ensure the model’s effectiveness, reliability, and the ethical implications.
The code testing consists of verifying the correctness and quality of the whole MLOps project code to ensure that the code is free from defects and meets the requirements of the project. Code testing includes the unit testing the different modules and functions, the integration testing of the end-to-end pipeline, the system testing and the acceptance testing using real-world data.
Overall, testing is an essential aspect in MLOps to ensure the correctness and the efficiency of the MLOps pipeline. It can also improve the other MLOps principles:
- It ensures the code changes made during versioning is functioning correctly.
- It improve the automation by adding it to the automation pipeline.
- It improves monitoring by detection potential issues.
- It also improve the reproducibility by ensuring that models can be reproduced consistently over time.
5. Automation

Automation is an MLOps principle that aims to automate the different pipeline processing including building, testing, deploying and managing. Automation defines how free the system is from human intervention: the more free the system from manual process, the more automated the system. Therefore, the level of automation defines the level of process’s maturity.
The process of data engineering is usually manual starting from data gathering and data preparation to data validation since this step has an experimental and iterative nature. However, some of steps can be automated such as data transformation and features manipulation. Automating these latter improves the accuracy and reduce manual errors.
ML model automation aims to automate the process from the model development to its deployment and management. It includes automating features engineering, model training, hyperparameters selection and tuning, model validation and model deployment. This latter reduces the time and resources required to build and deploy models, while also improving their quality and consistency especially when new data is available, the model change or for monitoring events. Automating the ML model development process can help to reduce the time and resources required to build and deploy models, while also improving their quality and consistency.
Code automation aims to reduce errors, increase efficiency, and improve overall quality. It includes the application build automation and the CD/CI pipelines automation to perform fast and reliable ML model deployments in production.
In summary, automation enables efficient and reliable implementation of the repetitive tasks and standardizes processes. Furthermore, it is interconnected with the other principles:
- It facilitates versioning by automating the management and tracking of different versions of code, data, and models.
- It facilitates testing by automating the execution of various tests, such as unit tests, integration tests, and performance tests.
- It facilitates monitoring by automating the collection, analysis, and visualization of relevant metrics and performance indicators.
- It facilitates reproducibility by automating the execution of code, workflows, and pipelines.
6. Monitoring and tracking

When the model is deployed, it is essential to monitor the MLOps project to assure the performance, stability and reliability of the ML model in production. If the monitoring detects an anomaly, the changes must be reported and the concerned developers must be alerted. Monitoring the different steps of MLOps consists of re-running and comparing them in a frequent basis.
Data monitoring in MLOps consists of continuously observing and analyzing the input data used in machine learning models to ensure its quality, consistency, and relevance. It includes monitoring the version change, the invariant in training and serving inputs, the invariant in the computed training and serving features, and the process of features generation.
ML model monitoring consists of tracking and evaluating the performance of machine learning models in production. It includes monitoring the model’s numerical stability, the model’s age and decay and the computational performance of the ML system.
Code monitring consists of tracking and evaluating the code used in machine learning project to ensure its quality, integrity, and adherence to coding standards. It includes monitoring the changes in source system, the dependencies upgrade and the predictive quality of the application on serving data.
Just as importantly, monitoring and tracking enable reproducibility by tracking the inputs, outputs, and execution of code, workflows, and models. In addition, by monitoring testing, anomalies in the model/system behavior and performance can be detected.
7. Reproducibility

Reproducibility is essential when building machine learning workflow. It allows to generate identical results giving the identical inputs regardless of the place of execution. To assure identical results the whole MLOps workflow needs to be reproducible.
Data reproducibility consists of capturing and preserving all the necessary information and processes related to data collection, preprocessing, and transformation, allowing others to obtain the same dataset for analysis or model training. It includes creating a backup for data, versioning data and features and creating and backup the metadata and documentation.
ML model reproducibility consists of to the ability to recreate and obtain the same trained machine learning model consistently. It includes ensuring that the parameters are the same and the order of the parameters is identical whether in development, production or on other machines.
Code reproducibility consists of the ability to recreate and obtain the same results from the code used for developing machine learning models. It includes ensuring that the dependencies version and the technical stack are identical for all environments. This is usually ensured by providing container images or virtual machines.
Overall, reproducibility is achieved by the other principles : versioning, testing, automation and monitoring work together to capture and maintain the necessary information, execute processes consistently, verify the correctness of results, and identify any factors that could impact the reproducibility of the models and workflows.
8. Conclusion
Here we come to the end of this article. In this article, we presented and briefly explained the MLOps principles. You can think of MLOps principles as the components that maintain the MLOps lifecycle. They are achieved whether by practices, tools or both. To ensure the maintenance of all entire lifecycle, they are applied on the different components of the MLOps workflow.
In the next tutorials, we will learn in deep of the different MLOps principles. I will be writing more tutorials on MLOps and its various technologies, with examples, so stay tuned.
Thanks for reading this article. You can find all the examples of the different tutorials I provide in my GitHub profile. If you appreciate my tutorials, please support me by following and subscribing. This way, you’ll receive notifications about my new articles. If you have any questions or suggestions, feel free to leave a comment.
Image credits
All images and figures in this article whose source is not mentioned in the caption are by the author.