This article was published as a part of the Data Science Blogathon.
The core of the data science project is data & using it to build predictive models and everyone is excited and focused on building an ML model that would give us a near-perfect result mimicking the real-world business scenario. In trying to achieve this outcome one tends to ignore the various other aspects of a data science project, especially the operational aspects. As ML projects are iterative in nature, tracking all the factors, configurations and results can become a very daunting task in itself.
With the growing and distributed data science teams, effective collaboration between teams becomes critical. The open-source tools that we will explore on this blog namely DVC Studio and MLFlow will help us to address some of these challenges by automatically tracking the changes/results from every iteration. To add more, both the tools give us a very interactive UI where the results are neatly showcased and of course, the UI is customizable !!.
All we need is the basics of machine learning, python, and version control account eg: Github. In this blog, Kaggle’s South Africa Heart Disease dataset will be used for running our experiments. Our target variable will be CHD (coronary heart disease).
Note: We will be using the same dataset and building the same model for sake of simplicity for both DVC Studio and MLflow use cases. Our aim is to understand the features of both the tools and not fine-tune the model building.
DVC is an open-source tool/library which can be plugged into version control tools like Github, Gitlab, Bitbucket, etc to import ML projects for experimenting and tracking. The studio has a UI to track the experiments/metrics. To know more about DVC explore its features.
Installation & setup: The pip install dvc should be fine for installation. For more information on the installation of the windows version, please refer to install DVC. You can download/clone the code from Github for quick reference. You can download/clone the code from Github for quick reference.
We will load the dataset, split it and then carry out the model building step. All the code/files can be found under the src folder – skipping the code walkthrough of this section to keep the blog relatively short. You can access the complete code and walkthrough from the blog.
Before we move further, let’s take a glimpse of how the experiment and KPI’s are tracked in DVC.
As you would have noticed above, the output is in the console, definitely not interactive, what about the plots that are so crucial for ML models?. Is there a way to filter results on a defined threshold? eg: If we need to view the experiments which have an accuracy of higher than 0.7. The only way is to write a piece of code to filter that specific data. That’s where the DVC studio makes it very simple and interactive. We will look into UI in the next sections.
DVC Studio: Set up the DVC studio by following the below steps.
Step 1: Navigate to the URL https://studio.iterative.ai, Sign in with your Github and you will be able to see Add a view at the top right of the screen.
Step 2: The GitHub repository that we have should be mapped to the DVC studio by clicking on Configure Git Integration Settings.
Step 3: Once step 2 is completed, it will open the Git Integrations section. Select the repository and provide access.
Step 4: Once mapped, the repo will be available for the creation of a view as below.
Step 5: Once the above steps are completed, click on the repo and open the tracker.
DVC studio experiment tracker UI
Model Comparison: Select the models of your choice and click on Compare to view the results.
Model Comparision
Run the experiments: There are two ways to run the experiments.
1. Make all the changes and check the code into the Github repository. The DVC studio automatically pulls the metrics on the studio for tracking.
2. The other way is to make changes on the DVC studio UI, run experiments, and then push it to Github.
MLflow is an open-source tool for tracking ML experiments. Similar to DVC studio it helps with collaboration, carry out a varied range of experiments and analysis. To know more about MLflow explore its features.
Setting Up Work Environment:
You can access the code repository for download/clone from Github. Install the mlflow and other libraries for model building, set up the config file to improve the code readability. The files can be found under the MLflow folder.
Monitoring Model Metrics: The last and the current metrics are tracked and listed as in snapshot. If the number of iterations increases then keeping track of the changes becomes a challenging process and rather than focussing on improving the model performance, we will spend a lot of time tracking the changes and resulting metrics.
Path Metric Old New Change reportscores.json Logistic Accuracy 0.62069 0.65517 0.03448 reportscores.json roc_auc 0.65093 0.72764 0.07671 reportscores.json test_score 62.06897 65.51724 3.44828 reportscores.json train_score 71.96532 74.27746 2.31214
MLflow gives us a nice MLflow UI which helps us to track everything on the UI. Once, we are ready to run our experiment (classification.py), the metrics are tracked and displayed in the UI with the below piece of code command.
mlflow ui## Here is the output INFO:waitress:Serving on http://127.0.0.1:5000
The URL is of the localhost, by clicking on the URL, we will be able to view the results in the UI. The UI is very user-friendly and one can easily navigate and explore the concerning metrics. The section highlighted in the red box below shows the tracking of metrics that are of our interest.
MLflow experiment tracker UI
In this blog, we had a look at an overview of MLOps and implemented it with open source tools namely DVC Studio and MLflow. These MLOps tools make tracking the changes and model performance hassle-free so that we can focus more on domain-specific tuning and model performance.
MLOps will continue to evolve in the future with more features added to the tools making the lives of data science teams that much easier in managing the operational side of machine learning projects.
If you liked the blog then here are articles on MLOps. Keep experimenting!
Tracking ML experiments with DVC
https://www.mlflow.org/docs/latest/quickstart.html
I am a Data Science enthusiast with experience in building predictive models, data processing, and data mining algorithms to solve challenging business problems. Involved in open source community and passionate about building data apps.
15+ Github Machine Learning Repositories for Da...
Optimizers in Deep Learning: A Detailed Guide
Tracking ML Experiments With Data Version Control
MLOps | Versioning Datasets with Git & DVC
Bring DevOps To Data Science With MLOps
MLOps now made simple using MLflow
A Guide to DVC and DAGsHub for Machine Learning...
Machine Learning Workflow Using MLFLOW -A Begin...
Getting Started with Data Version Control (DVC)
A Beginner’s Guide to Get Productive With...
We use cookies essential for this site to function well. Please click to help us improve its usefulness with additional cookies. Learn about our use of cookies in our Privacy Policy & Cookies Policy.
Show details
This site uses cookies to ensure that you get the best experience possible. To learn more about how we use cookies, please refer to our Privacy Policy & Cookies Policy.
It is needed for personalizing the website.
Expiry: Session
Type: HTTP
This cookie is used to prevent Cross-site request forgery (often abbreviated as CSRF) attacks of the website
Expiry: Session
Type: HTTPS
Preserves the login/logout state of users across the whole site.
Expiry: Session
Type: HTTPS
Preserves users' states across page requests.
Expiry: Session
Type: HTTPS
Google One-Tap login adds this g_state cookie to set the user status on how they interact with the One-Tap modal.
Expiry: 365 days
Type: HTTP
Used by Microsoft Clarity, to store and track visits across websites.
Expiry: 1 Year
Type: HTTP
Used by Microsoft Clarity, Persists the Clarity User ID and preferences, unique to that site, on the browser. This ensures that behavior in subsequent visits to the same site will be attributed to the same user ID.
Expiry: 1 Year
Type: HTTP
Used by Microsoft Clarity, Connects multiple page views by a user into a single Clarity session recording.
Expiry: 1 Day
Type: HTTP
Collects user data is specifically adapted to the user or device. The user can also be followed outside of the loaded website, creating a picture of the visitor's behavior.
Expiry: 2 Years
Type: HTTP
Use to measure the use of the website for internal analytics
Expiry: 1 Years
Type: HTTP
The cookie is set by embedded Microsoft Clarity scripts. The purpose of this cookie is for heatmap and session recording.
Expiry: 1 Year
Type: HTTP
Collected user data is specifically adapted to the user or device. The user can also be followed outside of the loaded website, creating a picture of the visitor's behavior.
Expiry: 2 Months
Type: HTTP
This cookie is installed by Google Analytics. The cookie is used to store information of how visitors use a website and helps in creating an analytics report of how the website is doing. The data collected includes the number of visitors, the source where they have come from, and the pages visited in an anonymous form.
Expiry: 399 Days
Type: HTTP
Used by Google Analytics, to store and count pageviews.
Expiry: 399 Days
Type: HTTP
Used by Google Analytics to collect data on the number of times a user has visited the website as well as dates for the first and most recent visit.
Expiry: 1 Day
Type: HTTP
Used to send data to Google Analytics about the visitor's device and behavior. Tracks the visitor across devices and marketing channels.
Expiry: Session
Type: PIXEL
cookies ensure that requests within a browsing session are made by the user, and not by other sites.
Expiry: 6 Months
Type: HTTP
use the cookie when customers want to make a referral from their gmail contacts; it helps auth the gmail account.
Expiry: 2 Years
Type: HTTP
This cookie is set by DoubleClick (which is owned by Google) to determine if the website visitor's browser supports cookies.
Expiry: 1 Year
Type: HTTP
this is used to send push notification using webengage.
Expiry: 1 Year
Type: HTTP
used by webenage to track auth of webenagage.
Expiry: Session
Type: HTTP
Linkedin sets this cookie to registers statistical data on users' behavior on the website for internal analytics.
Expiry: 1 Day
Type: HTTP
Use to maintain an anonymous user session by the server.
Expiry: 1 Year
Type: HTTP
Used as part of the LinkedIn Remember Me feature and is set when a user clicks Remember Me on the device to make it easier for him or her to sign in to that device.
Expiry: 1 Year
Type: HTTP
Used to store information about the time a sync with the lms_analytics cookie took place for users in the Designated Countries.
Expiry: 6 Months
Type: HTTP
Used to store information about the time a sync with the AnalyticsSyncHistory cookie took place for users in the Designated Countries.
Expiry: 6 Months
Type: HTTP
Cookie used for Sign-in with Linkedin and/or to allow for the Linkedin follow feature.
Expiry: 6 Months
Type: HTTP
allow for the Linkedin follow feature.
Expiry: 1 Year
Type: HTTP
often used to identify you, including your name, interests, and previous activity.
Expiry: 2 Months
Type: HTTP
Tracks the time that the previous page took to load
Expiry: Session
Type: HTTP
Used to remember a user's language setting to ensure LinkedIn.com displays in the language selected by the user in their settings
Expiry: Session
Type: HTTP
Tracks percent of page viewed
Expiry: Session
Type: HTTP
Indicates the start of a session for Adobe Experience Cloud
Expiry: Session
Type: HTTP
Provides page name value (URL) for use by Adobe Analytics
Expiry: Session
Type: HTTP
Used to retain and fetch time since last visit in Adobe Analytics
Expiry: 6 Months
Type: HTTP
Remembers a user's display preference/theme setting
Expiry: 6 Months
Type: HTTP
Remembers which users have updated their display / theme preferences
Expiry: 6 Months
Type: HTTP
Used by Google Adsense, to store and track conversions.
Expiry: 3 Months
Type: HTTP
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
Expiry: 2 Years
Type: HTTP
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
Expiry: 2 Years
Type: HTTP
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
Expiry: 2 Years
Type: HTTP
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
Expiry: 2 Years
Type: HTTP
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
Expiry: 2 Years
Type: HTTP
Save certain preferences, for example the number of search results per page or activation of the SafeSearch Filter. Adjusts the ads that appear in Google Search.
Expiry: 2 Years
Type: HTTP
These cookies are used for the purpose of targeted advertising.
Expiry: 6 Hours
Type: HTTP
These cookies are used for the purpose of targeted advertising.
Expiry: 1 Month
Type: HTTP
These cookies are used to gather website statistics, and track conversion rates.
Expiry: 1 Month
Type: HTTP
Aggregate analysis of website visitors
Expiry: 6 Months
Type: HTTP
This cookie is set by Facebook to deliver advertisements when they are on Facebook or a digital platform powered by Facebook advertising after visiting this website.
Expiry: 4 Months
Type: HTTP
Contains a unique browser and user ID, used for targeted advertising.
Expiry: 2 Months
Type: HTTP
Used by LinkedIn to track the use of embedded services.
Expiry: 1 Year
Type: HTTP
Used by LinkedIn for tracking the use of embedded services.
Expiry: 1 Day
Type: HTTP
Used by LinkedIn to track the use of embedded services.
Expiry: 6 Months
Type: HTTP
Use these cookies to assign a unique ID when users visit a website.
Expiry: 6 Months
Type: HTTP
These cookies are set by LinkedIn for advertising purposes, including: tracking visitors so that more relevant ads can be presented, allowing users to use the 'Apply with LinkedIn' or the 'Sign-in with LinkedIn' functions, collecting information about how visitors use the site, etc.
Expiry: 6 Months
Type: HTTP
Used to make a probabilistic match of a user's identity outside the Designated Countries
Expiry: 90 Days
Type: HTTP
Used to collect information for analytics purposes.
Expiry: 1 year
Type: HTTP
Used to store session ID for a users session to ensure that clicks from adverts on the Bing search engine are verified for reporting purposes and for personalisation
Expiry: 1 Day
Type: HTTP
Cookie declaration last updated on 24/03/2023 by Analytics Vidhya.
Cookies are small text files that can be used by websites to make a user's experience more efficient. The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies, we need your permission. This site uses different types of cookies. Some cookies are placed by third-party services that appear on our pages. Learn more about who we are, how you can contact us, and how we process personal data in our Privacy Policy.
Edit
Resend OTP
Resend OTP in 45s