M. ENGINEERING SYSTEMS
PORTFOLIO / 2026
INITIALIZING 00%
M.
A LITTLE SPACE TO BUILD BIG THINGS

WELCOME.

TO MOMNA'S ENGINEERING WORLD

CLOUD✳ DEVOPS✳ AUTOMATION✳ RELIABILITY✳ KUBERNETES✳ CLOUD✳ DEVOPS✳ AUTOMATION✳ RELIABILITY✳ KUBERNETES✳
SYSTEMS WITH PURPOSE
01 — 06

Designing a reproducible MLOps pipeline with MLflow and DVC

Machine learning models are not only about choosing an algorithm and getting a good accuracy score. A practical machine learning workflow also needs a way to manage datasets, track experiments, organize model versions and reproduce the steps used to generate a model.

For this project, I explored how to bring these pieces together by building an MLOps pipeline using MLflow, DVC and DagsHub. The project uses the Pima Indians Diabetes Dataset and a Random Forest classifier to demonstrate how data and machine learning experiments can be managed through a structured workflow.

Project Overview

The main objective was to connect machine learning development with practices commonly used in software and DevOps workflows. Instead of treating training as a one-time script execution, I organized the work into pipeline stages and added tools for versioning and experiment tracking.

The project brings together:

  • DVC: Tracks dataset versions and defines the pipeline stages and dependencies.
  • MLflow: Records experiment parameters, evaluation metrics and model-related artifacts.
  • DagsHub: Provides remote collaboration and connects the project’s data and experiment-tracking workflow.
  • Python: Runs the data and model workflow.
  • Scikit-learn: Provides the Random Forest classifier and GridSearchCV.
  • Pandas and NumPy: Support dataset handling and processing.

1. Understanding the MLOps Architecture

The workflow starts with the Pima Indians Diabetes Dataset. DVC is used to organize the pipeline and track data-related changes, while the machine learning scripts handle the workflow stages.

The pipeline is defined in dvc.yaml. Its stages describe the dependencies and commands involved in preprocessing, model training and evaluation. This gives the workflow a defined structure instead of relying on manually running unrelated scripts.

MLflow complements this process by recording experiment information, including parameters, metrics and artifacts. DagsHub connects the project with remote storage and experiment collaboration.

MLOps workflow architecture showing DVC data versioning, preprocessing, model training, evaluation and MLflow experiment tracking
Figure 1. Overview of the MLOps workflow and the tools used in the project.

2. Managing Data and Pipeline Stages with DVC

Data versioning is important because a model’s output depends on the data used during development. If a dataset changes, it becomes difficult to understand or reproduce an earlier result without a way to track those changes.

I used DVC (Data Version Control) to manage the dataset and define the pipeline. Rather than relying only on Git to store large data files, DVC provides a way to track data versions and maintain references to the corresponding files.

The pipeline configuration is maintained in dvc.yaml, while dvc.lock records the resolved information for the pipeline stages. The project also includes params.yaml for configuration values.

This structure helps connect the scripts, dependencies and outputs. When a tracked dependency changes, DVC can identify which stages need to be executed again.

3. Organizing the Machine Learning Workflow

The pipeline is organized into three main stages:

Preprocessing

The preprocessing stage is defined as part of the DVC workflow. In the current implementation, it performs a lightweight data preparation step by copying the source CSV into the processed-data location. It provides a separate stage in the pipeline structure that can be expanded with more substantial cleaning and transformation logic.

Model Training

For model training, I used RandomForestClassifier from Scikit-learn. The training script also uses GridSearchCV to explore selected hyperparameter combinations, including the number of estimators, maximum tree depth and minimum samples required for splits and leaves.

This makes it possible to compare different configurations instead of relying on a single manually selected set of model parameters. The trained model is serialized as model.pkl.

Evaluation

The evaluation stage calculates an accuracy metric for the trained model. This provides a basic way to inspect model performance and record an evaluation result as part of the workflow.

A separate held-out test dataset would make this evaluation stronger. That is an improvement to consider when extending the current implementation.

4. Tracking Experiments with MLflow

Training a model can involve multiple parameter configurations and runs. Without experiment tracking, comparing those runs can become difficult, especially when results are recorded manually.

I integrated MLflow to track experiment information. The project records parameters, metrics and artifacts so that the results of model development can be inspected and compared.

Some of the information tracked through the workflow includes:

  • Model configuration and selected hyperparameters.
  • Evaluation metrics such as accuracy.
  • Model-related artifacts generated during training.
  • Experiment runs that can be reviewed and compared.

This creates a clearer record of how a model was trained and what results were produced. It also makes experiment history more useful than keeping isolated metric values in terminal output or notes.

5. Connecting the Workflow with DagsHub

DagsHub brings remote project collaboration and experiment tracking into the workflow. In this project, it is used alongside DVC and MLflow to support remote data and experiment management.

Keeping the code, pipeline configuration, data-version references and experiment information organized makes it easier to revisit the development process. It also provides a shared place to inspect the project’s tracked work.

6. Reproducing the Pipeline

One of the main reasons for structuring the workflow with DVC is that the pipeline can be executed through a defined command:

dvc repro

DVC checks the pipeline stages and their dependencies to determine which steps need to run. This reduces the need to manually execute each script in the correct order.

Combined with Git-tracked configuration files, DVC’s data-versioning mechanism and MLflow’s experiment records, the project provides a more organized foundation for revisiting previous machine learning work.

Reproducibility also depends on the implementation details. For example, the configured random_state should be consistently applied to the relevant training operations to improve repeatability of model results. This is an area for further refinement in the current project.

7. What I Learned and Future Improvements

This project helped me understand how MLOps tools can complement one another. DVC manages data and pipeline structure, MLflow records experiment information, and DagsHub supports remote collaboration.

It also highlighted that building a pipeline is only one part of a reliable machine learning workflow. There are several areas I would improve in a future iteration:

  • Expand preprocessing with meaningful data-cleaning and transformation steps.
  • Use a separate held-out test dataset for model evaluation.
  • Apply fixed random seeds consistently where appropriate.
  • Strengthen model validation and experiment comparison.
  • Add automated testing and a deployment workflow.
  • Introduce model monitoring and data validation as the project evolves.

Model serialization and artifact tracking are included in the current workflow, but a production model-serving or deployment system is not part of this implementation.

Conclusion

Building this MLOps pipeline gave me practical experience with the tools used to organize machine learning development beyond model training alone. I learned how data versioning, pipeline orchestration and experiment tracking can work together to make model development easier to manage and review.

For me, the most valuable takeaway was understanding the connection between DevOps principles and machine learning workflows. A model is only one part of the system; managing the data, tracking experiments and keeping the process organized are equally important.

Project Repository

The complete project source code and configuration files are available on GitHub:

View the MLOps Pipeline Project on GitHub →

Technologies: Python · DVC · MLflow · DagsHub · Scikit-learn · Pandas · NumPy · Git · GitHub

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top