marți, 12 decembrie 2023

A brief introduction to MLOps

What is MLOps?

Machine Learning operations involve applying a set of processes, or more specifically, a sequence of steps to integrate a Machine Learning model into the production environment. There are several stages to go through before such a model is ready for deployment, and these processes ensure that the model can be scaled to meet a large user base and provide accurate results.



Why do we need MLOps?

Creating a machine learning model that can make predictions based on provided data is a relatively straightforward task. However, obtaining a machine learning model that is reliable, fast, accurate, and can be used by a large number of users poses a challenging endeavor.

The importance of MLOps can be summarized in the following points:


1. Machine learning models rely on a vast amount of data that is challenging for a single person to monitor.
2. Tracking the parameters we adjust in machine learning models is difficult, and minor changes can have a significant impact on the results.
3. It is necessary to keep track of the features the model works with, and feature engineering is a separate task that significantly contributes to the model's accuracy.
4. Monitoring a machine learning model is not akin to monitoring an already deployed software application or web application.
5. Debugging a machine learning model is an extremely complicated art.
6. Models rely on real-world data to make predictions, and with changes in real-world data, the model must evolve accordingly. This means monitoring changes in new data and ensuring the model learns accordingly.
7. Let's not forget the old reason cited by Software Engineers. The intention is to avoid that situation.

DevOps vs MLOps


The stages of DevOps are designed for the development of a software application. You plan the features of the application you want to launch, write code, build the code, test it, create a release plan, and deploy it. You monitor the infrastructure where the application is deployed. And this cycle continues until the application is fully built.

The Goal — We define the project, check if the problem requires the use of Machine Learning to solve it. We conduct requirement engineering, check if relevant data is available. We ensure that the data is not biased and reflects real-world usage scenarios.





MLOps Workflow

MLOps pipelines typically include steps such as data ingestion, data preprocessing, model training, model testing, model deployment, and model monitoring.




#1 Data preparation and management

The first phase in any machine learning process is the collection of data. Without clean and accurate data, the models are useless. Hence, data preparation & management is a crucial phase in MLOps workflow.It involves collecting, cleaning, transforming, and managing data so that we have the correct data in place to train the ML models. The end goal is to have data that is complete and accurate.

#2 Model training and validation

Once you have the data ready, you can feed it to your machine-learning models to train them. This is where you ensure that your models are trained well, and validated to ensure they perform accurately in production.

#3 Model deployment

After the model is trained and the performance is validated, it’s time to deploy it to production. The model deployment phase involves taking the model that has been trained, tested, and validated in earlier phases and making it available for use by other applications or systems.

#4 Continuous model monitoring & retraining

Machine learning models aren’t something like deploy and forget. One needs to constantly monitor the model’s performance and accuracy. Since the real world can change which might affect the efficiency and accuracy of the model.

Popular tools:

MLFlow, Seldon Core, Metaflow, and Kubeflow Pipelines.

Sources:

1. https://www.infracloud.io/blogs/introduction-to-mlops/
2. https://github.com/visenger/awesome-mlops
3. https://towardsdatascience.com/a-gentle-introduction-to-mlops-7d64a3e890ff

 

Niciun comentariu:

Trimiteți un comentariu

Gestionarea traficului prin inteligenta artificiala

  Gestionarea traficului             Circulația rutieră devine din ce în ce mai aglomerată și mai lentă, favorizându-se producerea a numeroa...