ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing
ApX logoApX logo
ModelsCalculatorHardwareCoursesPricing

All Courses

Data Versioning and Experiment Tracking for Machine Learning
Chapter 1: The Need for Reproducibility in Machine Learning
Challenges in Managing ML Projects
Why Git Alone Is Not Sufficient
Defining Reproducibility in ML
Components of a Reproducible ML Workflow
Introduction to Data Versioning Concepts
Introduction to Experiment Tracking Concepts
Quiz for Chapter 1
Chapter 2: Versioning Data with DVC
Data Versioning Strategies
Introducing Data Version Control (DVC)
Setting Up DVC in a Project
Tracking Data Files and Directories
Storing and Retrieving Data Versions
Connecting DVC to Remote Storage (S3, GCS, Azure Blob)
Switching Between Data Versions
Hands-on Practical: Versioning a Dataset
Quiz for Chapter 2
Chapter 3: Tracking Experiments with MLflow
The Importance of Experiment Tracking
Introducing MLflow Tracking
Setting up MLflow
Logging Parameters and Metrics
Logging Artifacts (Models, Plots, Files)
Organizing Runs with Experiments
Using the MLflow UI
Comparing Experiment Runs
Practice: Tracking a Training Run
Chapter 4: Integrating DVC and MLflow for Reproducible Workflows
Connecting Data Versions to Experiments
Structuring Projects for Integration
Logging DVC Metadata in MLflow
Creating DVC Pipelines
Reproducing DVC Pipelines
Tracking DVC Pipeline Metrics
Combining DVC Pipelines and MLflow Tracking
Best Practices for Integrated Workflows
Hands-on Practical: Building an Integrated Pipeline

Why Git Alone Is Not Sufficient

Git has become the standard for versioning source code, and for good reason. It allows teams to collaborate effectively, track changes over time, revert to previous states, and manage different lines of development through branching. For software development, Git is often sufficient for ensuring that the codebase itself is reproducible. If you have the code from a specific Git commit, you can typically rebuild the software as it existed at that point (assuming external dependencies are also managed).

However, machine learning projects introduce complexities that stretch Git past its intended design, particularly when it comes to data and model artifacts. Here's why relying solely on Git for ML reproducibility falls short:

The Challenge of Large Files

Machine learning often starts with data, and datasets can be large, easily ranging from gigabytes to terabytes. Similarly, trained models, especially complex ones like deep learning networks, can also result in large binary files.

Git wasn't designed to handle large binary files efficiently. Its core mechanism involves storing snapshots of all tracked files for each commit. When you commit changes to a large file, Git essentially stores a new copy (or a compressed delta, but storage still grows significantly). This leads to several problems:

  1. Repository Bloat: Storing multiple versions of large files causes the .git directory to grow rapidly, making the repository unwieldy.
  2. Performance Degradation: Operations like git clone, git checkout, and git push become painfully slow as they need to transfer and manage these large files. Checking out a previous commit might involve downloading gigabytes of data, even if you only needed the code from that point.
  3. Storage Costs and Limits: Hosting providers often have limits on repository size. Even with self-hosting, the storage requirements can become excessive.

For example, imagine you have a 10GB dataset. If you add it to Git and then update it, perhaps by adding new samples or preprocessing, Git will store versions of this large file. A few updates later, your repository size could easily balloon by tens or hundreds of gigabytes.

Git LFS: A Partial Solution

Recognizing the issue with large files, Git Large File Storage (LFS) was developed. Git LFS replaces large files in your Git repository with small text pointers. The actual large files are stored on a separate LFS server. When you check out a commit, Git retrieves the code, and the Git LFS client downloads the corresponding large files based on the pointers.

While Git LFS helps mitigate the repository bloat and performance issues associated with storing large files directly in Git, it doesn't fully address the reproducibility needs of ML workflows:

  • Metadata Disconnect: LFS primarily manages storage. It doesn't inherently link the specific version of a dataset used in a training run to the resulting model or the metrics achieved. You still need a separate mechanism to record "Model X was trained using dataset pointer Y with code commit Z".
  • Data Lineage: LFS tracks file versions, but it doesn't capture the lineage of data transformations. If your dataset undergoes multiple preprocessing steps (cleaning, feature engineering), LFS alone doesn't represent this workflow or allow you to easily reproduce intermediate data states.
  • Operational Overhead: Setting up and managing an LFS server adds complexity, and synchronizing LFS files still requires explicit git lfs pull commands.

Tracking Experiments, Not Just Files

Reproducibility in ML isn't just about having the right version of the code and the data files. It's about recreating the entire experimental context:

  • Which specific version of the data was used? (e.g., dataset_v2.1.csv)
  • Which version of the code processed the data and trained the model? (e.g., Git commit a1b2c3d)
  • What hyperparameters were used for training? (e.g., learning rate = 0.001, batch size = 32)
  • What were the resulting metrics? (e.g., Accuracy = 92.5%)
  • Which specific software environment and dependencies were active?

Git tracks code changes effectively. It can track data files (with difficulty or via LFS), but it has no built-in mechanism for systematically logging hyperparameters, metrics, or the intricate dependencies between specific data versions, code versions, and experimental outcomes. Committing configuration files helps, but it doesn't provide a queryable, centralized record of experiments or link directly to the specific large data assets used.

Trying to manage this information solely through Git commit messages or separate spreadsheets quickly becomes unmanageable and error-prone, especially as the number of experiments grows.

Therefore, while Git is an essential foundation for versioning the code component of ML projects, we need complementary tools designed specifically to handle the challenges of versioning large datasets and tracking the full context of experiments. This is where tools like Data Version Control (DVC) and MLflow come into play, working alongside Git to provide a more complete solution for ML reproducibility.

  • Pro Git, Chapter 10.3 Packfiles, Scott Chacon, Ben Straub, 2014 (Apress) - Explains Git's internal data storage mechanisms, particularly packfiles, illustrating why large binary files lead to repository bloat and performance degradation.
  • Git Large File Storage (LFS), GitHub, 2023 (GitHub) - Official documentation detailing the design and operation of Git LFS, and how it manages large files outside the core Git repository.
  • Why DVC?, Iterative.ai, 2023 (Iterative.ai) - Explains the limitations of Git and Git LFS for versioning large datasets and tracking machine learning experiments, advocating for specialized tools like DVC.

© 2026 ApX Machine Learning