<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by William Van on Medium]]></title>
        <description><![CDATA[Stories by William Van on Medium]]></description>
        <link>https://medium.com/@william-van?source=rss-1af35602aa78------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Fc6jXiAqJuq58BzK</url>
            <title>Stories by William Van on Medium</title>
            <link>https://medium.com/@william-van?source=rss-1af35602aa78------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 15:10:55 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@william-van/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Introduction to MLFlow]]></title>
            <link>https://medium.com/episource-developers/asdf-8455b018c9f1?source=rss-1af35602aa78------2</link>
            <guid isPermaLink="false">https://medium.com/p/8455b018c9f1</guid>
            <dc:creator><![CDATA[William Van]]></dc:creator>
            <pubDate>Thu, 01 Jul 2021 16:11:43 GMT</pubDate>
            <atom:updated>2021-08-18T21:33:21.933Z</atom:updated>
            <content:encoded><![CDATA[<p>The development lifecycle of production machine learning (ML) systems has many moving parts, all of which are required to create, maintain and deploy a finished model. Enter: MLFlow</p><h3><strong>What is MLFlow?</strong></h3><blockquote>MLflow is an open source platform to manage the ML lifecycle, including experimentation, reproducibility, deployment, and a central model registry.</blockquote><h3><strong>History</strong></h3><p>MLFlow was created in 2018 by the company Databricks to address the problems revolving around the fragmented development lifecycle that plagued ML models; <a href="https://cs.stanford.edu/people/matei/">Matei Zaharia</a>, one of the founders behind Apache Spark and Chief Technologist at Databricks led MLFlow’s development. Since it was open sourced in 2018, MLFlow has been adopted by a large number of companies and boasts over 300 contributors and 9,500+ stars on its <a href="https://github.com/mlflow/mlflow">Github</a> page.</p><p>Some highlights of MLFLow that make machine learning development simpler include:</p><ul><li>Metric Tracking</li><li>Parameter Tracking</li><li>Model Versioning</li><li>Model Tagging</li><li>Artifact Storage</li></ul><p>For this particular tutorial, we will use Tensorflow as our model backend, but MLFLow is model agnostic, meaning we can use other machine learning libraries such as Pytorch, Sklearn, h2O, etc.</p><p>To store the model and any other artifacts associated with training (config files, json files, text files) we can use Amazon S3 as a backend to save artifacts. MLFlow comes with the default option of using the filesystem to save artifacts but S3 and other cloud storage solutions might be preferred in production systems. MLFlow also uses the prescribed filesystem to store metrics and params; but those can also be saved to a database backend like Postgres or MySQL. This flexibility allows users to scale as their needs grow, from local experimentation to distributed production model deployment.</p><h3>Benefits of MLFlow</h3><ul><li>Eliminates manual calculation of model performance</li><li>Eliminates manual effort required to archive models locally</li><li>Provides historical view of past models</li><li>Promote models to Staging/Production environments</li><li>Allows engineers to rapidly test new ideas and architectures</li></ul><h4>Dashboard UI</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fwr959D9OtYKcZ-VWbuwEw.png" /><figcaption>Model experiment organization</figcaption></figure><h3>How it works</h3><p>MLFlow exposes a REST endpoint over port 5000 to record metrics and communicate artifacts. For each model that is trained, users can specify the “<em>EXPERIMENT_NAME</em>” name which appears on the left-hand side. This feature allows different architectures of models to be grouped together allowing historical metrics and scores per model to be displayed in one table.</p><p>After installing the pip package to run MLFlow in Python, a small code sample is as follows:</p><pre>import mlflow<br>mlflow.set_experiment(experiment_name=EXPERIMENT_NAME)<br><br>with mlflow.start_run(run_name=&quot;version_1&quot;) as run:<br>    ...<br>    mlflow.log_param(&#39;nn_layers&#39;, len(model.layers))<br>    mlflow.log_metric(&quot;accuracy&quot;, acc_a, step=epoch)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsWYdU_eQQvCUqGZ8eTF3w.png" /></figure><p>MLFlow records the datetime for each of our runs along with any parameters we want using the mlflow.log_param() method. Params differ from metrics in that params appear only once, things like how many times we trained our model (epochs), or how long it took to train, fall in this category; think (key-value pairs. Metrics on the other hand are things that occur repeatedly, and often change over time, such as the model’s accuracy and the model’s overall loss or error over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZXoppscqF-ToDKHCS8Weg.png" /><figcaption>Artifact storage</figcaption></figure><p>If we click on one of the models (keras) or datetimes, we will be able to view the artifacts saved in S3 (the S3 location is specified before the MLFlow process is first launched). Each time we run a model, MLFlow automatically creates a unique hash that is used to define the model’s folder location in S3. From the left hand menu, MLFlow stores all the config files, requirements.txt (if we want to relaunch the model using pip), and finally, the finished model in the “data” folder. We can download the model and and use it for inference, or distribute it to different teams/developers.</p><h3>Model Registry</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WQmMNE3VUML1Ocoa2mkCjg.png" /><figcaption>Registering a model</figcaption></figure><p>Within MLFlow, users can tag models to different environments such as “Archived”, “Experimental”, “Staging”, or “Production”. This is helpful to bookmark models that have performed well that we want to keep. MLFlow provides an API call that can retrieve the specified model for a given environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Qjh3IFg5BljDKZjuuePFg.png" /><figcaption>Registering model to registry</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gZkIM715wC-9ub9liyrZTQ.png" /><figcaption>Promote models to different environments</figcaption></figure><p>We can create different registry keys (i.e. “TEST”) to group our tagged models in one location. Each time we register a model to the same Registry key, the “Latest Version” field gets incremented automatically for us. Another option we have, is to change models from one environment to another, such as promoting Staging model to Production. This helps keep track of different models we deploy across environments and programmatically download and deploy models from our registry which is a powerful feature.</p><h3>Summary</h3><p>MLFLow is a powerful tool to help machine learning engineers catalog experimental models and have a historical perspective across all their models allowing them to pick the most performant one to promote to Production. Not only that, it has helped centralize all aspects of training a model, and gives the ability to repeat/recreate experiments for well performing models. It reduces the manual effort that was required to keep track of different models and performance reports.</p><p>MLFlow comes highly recommended to help streamline machine learning tasks and provide valuable insights into past models.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8455b018c9f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/episource-developers/asdf-8455b018c9f1">Introduction to MLFlow</a> was originally published in <a href="https://medium.com/episource-developers">Episource Developers</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>