<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>article MLOps Gym - Beginners Guide to MLflow in Technical Blog</title>
    <link>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/ba-p/62593</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SepidehEb_0-1710925847561.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6720iB3EF1364FCE31725/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SepidehEb_0-1710925847561.png" alt="SepidehEb_0-1710925847561.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;H1&gt;&lt;SPAN&gt;MLflow&lt;/SPAN&gt;&lt;/H1&gt;
&lt;P&gt;&lt;A href="https://mlflow.org/docs/latest/introduction/index.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;MLflow&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; stands out as the leading open source MLOps tool, and we strongly recommend its integration into your machine learning lifecycle. With its diverse components, MLflow significantly boosts productivity across various stages of your machine learning journey. The utilisation of MLflow is integral to many of the patterns we showcase in the MLOps Gym.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Built on top of OS MLflow, Databricks offers a managed MLflow service that focuses on enterprise reliability, security, and scalability. Among its many advantages, the managed version of MLflow natively integrates with &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/notebooks/index.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Databricks Notebooks&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, making it simpler to kickstart your MLOps journey. For a detailed comparison between OS and Managed MLflow, refer to the &lt;/SPAN&gt;&lt;A href="https://www.databricks.com/product/managed-mlflow" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Databricks Managed MLflow product page&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Although MLflow encompasses seven core components (&lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/tracking.html#tracking" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Tracking&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/model-registry.html#registry" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Model Registry&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/llms/deployments/index.html#deployments" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;MLflow Deployment for LLMs&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/models.html#model-evaluation" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Evaluate&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/llms/prompt-engineering/index.html#prompt-engineering" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Prompt Engineering UI&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/recipes.html#recipes" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Recipes&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, and &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/projects.html#projects" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Projects&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; ) as of the current date (March 2024), our focus in this article will be on the initial five components. We chose these components because they are most effective in solving MLOps challenges for our customers with minimal friction. We will provide recommendations on when and how to leverage them effectively.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;We have broken this guide to MLflow into three parts:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;I&gt;&lt;SPAN&gt;Beginners’ guide to MLflow &lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;will cover MLflow essentials for all ML practitioners. In this article, we discuss &lt;/SPAN&gt;&lt;STRONG&gt;Tracking&lt;/STRONG&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;STRONG&gt;Model Registry&lt;/STRONG&gt;&lt;SPAN&gt; components.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;A href="https://community.databricks.com/t5/technical-blog/mlops-gym-evaluating-large-language-models-with-mlflow/ba-p/72815" target="_blank"&gt;&lt;I&gt;&lt;SPAN&gt;Evaluating Large Language Models with MLflow&lt;/SPAN&gt;&lt;/I&gt;&lt;/A&gt; &lt;SPAN&gt;is dedicated to the &lt;/SPAN&gt;&lt;STRONG&gt;Evaluate &lt;/STRONG&gt;&lt;SPAN&gt;component.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Deploying Large Language Models with MLflow will cover the remainder of MLflow’s LLM-related components such as &lt;STRONG style="color: #1b3139; font-family: inherit;"&gt;MLflow Deployment for LLMs&lt;/STRONG&gt;&lt;SPAN&gt; and&lt;/SPAN&gt; &lt;SPAN&gt;the&lt;/SPAN&gt;&lt;STRONG style="color: #1b3139; font-family: inherit;"&gt; Prompt Engineering UI&lt;/STRONG&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Here are our suggested steps for getting started with MLflow. Remember that in the remainder of this article, “MLflow” refers to the Databricks-managed version of MLflow.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2 id="toc-hId--440979465"&gt;&lt;SPAN&gt;You won't want to miss this...&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;As a companion to this article, we spoke to&amp;nbsp;one of our most valued partners,&amp;nbsp;&lt;A href="https://www.linkedin.com/in/gavitaregunath/" target="_self" rel="nofollow noopener noreferrer"&gt;Gavi Regunath&lt;/A&gt;, about this subject. You can watch the recording of that discussion on the&amp;nbsp;&lt;A href="https://www.youtube.com/@AdvancingAnalytics" target="_self" rel="nofollow noopener noreferrer"&gt;Advancing Analytics YouTube channel&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;IFRAME src="https://www.youtube.com/embed/xsHPiIuEC1I?si=LEc262QKLMqE4aGg" width="100%" height="400" frameborder="0" allowfullscreen="" title="YouTube video player" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin"&gt;&lt;/IFRAME&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;&lt;BR /&gt;Use MLflow Tracking&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Your entry point to the MLflow world is probably MLflow Tracking. Using this component, you can log every aspect of your machine learning experiment, such as source properties, parameters, metrics, tags, and artifacts. MLflow Tracking assists data scientists during training and evaluating models, obviating the need to manually record the parameters and results of every experiment and facilitating reproducibility.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;MLflow Tracking comprises the following components:&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;A href="https://www.mlflow.org/docs/latest/tracking/server.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Tracking Server&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, which is an HTTP server hosted on Databricks Control Plane for tracking runs/ experiments.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;A href="https://www.mlflow.org/docs/latest/tracking/backend-stores.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Backend Store&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, which is a SQL database hosted on Databricks Control Plane to store metadata for runs/experiments such as run id, start and end time, parameters, etc.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;A href="https://www.mlflow.org/docs/latest/tracking/artifacts-stores.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Artifact store&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, which is where MLflow stores the actual artifacts of runs such as model weights, data files, etc. Databricks uses &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/dbfs/index.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;DBFS&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; as its default artifact store for MLflow.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Tracking &lt;/SPAN&gt;&lt;A href="https://www.mlflow.org/docs/latest/tracking.html#tracking-ui" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;UI&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;A href="https://www.mlflow.org/docs/latest/tracking/tracking-api.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;APIs&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, which allow you to interact with MLflow Tracking API through UI or API calls, respectively. The UI has tools for exploring metadata and artifacts and comparing performance metrics between runs.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;SPAN&gt;The key concepts in the MLflow Tracking realm are &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;runs&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;I&gt;&lt;SPAN&gt;experiments&lt;/SPAN&gt;&lt;/I&gt;&lt;SPAN&gt;. Runs are a detailed record of individual executions of code. Each run captures the associated metadata and resulting output or “artifacts”. An experiment is a collection of runs related to a specific ML task that allows for easier comparison.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example, for a single command execution or "run" of &lt;FONT face="courier new,courier"&gt;python train.py&lt;/FONT&gt;, MLflow Tracking would record the artifacts such as the model weights, images, etc.; as well as metadata such as the metrics, parameters, and start/end times. A collection of these runs with different variations (e.g. the ML algorithm) could be grouped as an experiment which allows you to more easily compare and select the best-fitting model.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For more information, you can refer to the &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/tracking.html#concepts" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;MLflow documentation&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;On Databricks, matters are made even simpler. By default, a notebook is linked to an experiment with the same name, and the runs of that experiment are all bundled together.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;How do you interact with MLflow Tracking on Databricks?&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;MLflow Tracking tightly integrates with Databricks ecosystem. There are multiple touchpoints with MLflow Tracking on the Databricks platform, including ML Runtimes, Notebooks, and the Tracking UI (Experiments).&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;SPAN&gt;ML Runtime&lt;/SPAN&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;MLflow is provided out-of-the-box with &lt;/SPAN&gt;&lt;A href="https://www.databricks.com/product/machine-learning-runtime" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;ML Runtimes&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;. On Standard Runtimes, you can&lt;/SPAN&gt;&lt;A href="https://pypi.org/project/mlflow/" target="_blank" rel="noopener"&gt;&lt;SPAN&gt; install MLflow using PyPi&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H4&gt;&lt;SPAN&gt;Notebooks&lt;/SPAN&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;MLflow is natively integrated with Databricks Notebooks. That means two things:&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;You can import MLflow and call its various methods using your API of choice (&lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/python_api/index.html#python-api" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Python&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/rest-api.html#rest-api" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;REST&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/R-api.html#r-api" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;R API&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, and &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/java_api/index.html#java-api" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Java API&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;). The managed Tracking Server will capture and log whatever you ask it to such as parameters, metrics, artifacts, etc. MLflow provides these capabilities out of the box without you needing to set up any infrastructure or tweak any knobs to get this functionality. Additionally, each run preserves the version of the notebook associated with it, making it completely reproducible.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;The &lt;/SPAN&gt;&lt;A href="https://www.databricks.com/blog/2019/04/30/introducing-mlflow-run-sidebar-in-databricks-notebooks.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;MLflow Run Sidebar&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, located on the right-hand side of your Notebooks, lets you monitor runs directly within your notebooks. It enables you to capture a snapshot of each run, ensuring that you can revisit earlier versions of your code at any time.&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;H5&gt;&lt;SPAN&gt;Autologging&lt;/SPAN&gt;&lt;/H5&gt;
&lt;P&gt;&lt;SPAN&gt;As of ML Runtime 10.3, &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/mlflow/databricks-autologging.html#databricks-autologging" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Autologging&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; is available on all Databricks notebooks. Autologging means you don’t need to import and call MLflow explicitly to capture your experiments. All you need to do is write your training code using &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/mlflow/databricks-autologging.html#supported-environments-and-frameworks" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;a variety of supported ML libraries&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; (e.g., sklearn), and pretty much every aspect of the experiment, including metrics, parameters, model signature, artifacts, and dataset, will be logged automatically.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When you attach your notebook to an ML Runtime, Databricks Autologging calls &lt;FONT face="courier new,courier"&gt;mlflow.autolog()&lt;/FONT&gt; which then uses a predefined set of parameters, metrics, artifacts, etc. to log your experiments. If you want to log any other aspect of your experiment not covered by Autologging (e.g., SHAPLY values), you can &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/mlflow/databricks-autologging.html#track-additional-content" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;manually log them using the MLflow client&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One important point to note is that when creating a run using the &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/python_api/mlflow.html#module-mlflow" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;MLflow fluent API&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;, autologging isn’t applied automatically. You will have to call &lt;FONT face="courier new,courier"&gt;mlflow.autolog()&lt;/FONT&gt; manually within the “with” block for it to take effect.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="highlight"&gt;&lt;CODE&gt;with mlflow.start_run() as run:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;mlflow.autolog()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;....&lt;/CODE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;H4&gt;&lt;SPAN&gt;Tracking UI&lt;/SPAN&gt;&lt;/H4&gt;
&lt;P&gt;&lt;SPAN&gt;Everything you capture in your notebooks using MLflow Tracking is visible under the Experiments tab in Databricks. By default, there is a 1:1 mapping between notebooks and experiments. Therefore in the Tracking UI, you can find all the notebook runs under one experiment. If you click on an experiment, you can further explore the experiment's runs and drill down on relevant information about that experiment.&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SepidehEb_1-1710925847528.png" style="width: 727px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6719iA19AE81E20B7FF78/image-dimensions/727x218?v=v2" width="727" height="218" role="button" title="SepidehEb_1-1710925847528.png" alt="SepidehEb_1-1710925847528.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="SepidehEb_2-1710925847508.png" style="width: 726px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6718iE7E80054DF920DD7/image-dimensions/726x254?v=v2" width="726" height="254" role="button" title="SepidehEb_2-1710925847508.png" alt="SepidehEb_2-1710925847508.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;How can I start using MLflow Tracking?&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;Now that you know the essentials of MLflow Tracking, open a notebook and begin writing your ML code. Autologging will automatically capture the training run metadata for you. Navigate to the Experiments tab and look for the experiment with the same name as your notebook. Analyse the run metrics, parameters, etc., embedded within that experiment.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;Use MLflow Model Registry with Unity Catalog&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Another critical component of MLflow is the Model Registry. It provides a centralised repository for managing and organising machine learning models. You can think of Model Registry as a one-stop shop for all the models you want to “keep” for deployment, testing, or any other purposes. Models that are “logged” with MLflow Tracking can be “registered” to the Model Registry.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;What is a model flavour?&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;A model flavour refers to how a machine learning model is packaged and stored. When registering a model, you can register it with a “&lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/models.html#built-in-model-flavors" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;native&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;” flavour such as sklearn, TensorFlow, etc., or with a Python flavour known as “&lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/models.html#python-function-python-function" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;pyfunc&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;.” A native flavour saves the model as a native object (e.g., a pickle file for sklearn flavour). In contrast, the pyfunc flavour stores the models as a generic &lt;/SPAN&gt;&lt;A href="https://mlflow.org/docs/latest/python_api/mlflow.pyfunc.html#filesystem-format" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;filesystem format&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; defined and supported by MLflow.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you register a model with a pyfunc flavour, you can only load and use it as a Python object. However, suppose you register a model with a native flavour, Databricks will automatically create an additional Python flavour for you, enabling you to load and use the model both as a native object or a Python one.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;Workspace Model Registry vs Unity Catalog Model Registry&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;Before the introduction of &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/mlflow/models-in-uc.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;Models in Unity Catalog (UC&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt;), the default scope for the Model Registry home was limited to a workspace. This meant you could only access a model registered to your Model Registry within the boundaries of that specific workspace. If you wanted to move models from one workspace to another (e.g., to promote from a dev workspace to a prod one), you had to go through the extra trouble of using&lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/mlflow/migrate-mlflow-objects.html#copy-mlflow-objects-between-workspaces" target="_blank" rel="noopener"&gt;&lt;SPAN&gt; an open source tool&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; to move objects between workspaces. Another option was to &lt;/SPAN&gt;&lt;A href="https://docs.databricks.com/en/machine-learning/manage-model-lifecycle/multiple-workspaces.html" target="_blank" rel="noopener"&gt;&lt;SPAN&gt;set up a remote Model Registry&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN&gt; and share it between workspaces, which was also laboursome.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Models in UC solve this problem and much more. Now, models live in UC alongside your features and raw data, making lineage tracking seamless. UC takes the concept of Model Registry outside the boundaries of a workspace and holds it at an account level. You can register your models in a schema of a catalog, easily accessed between different workspaces or moved to other catalogs/schemas.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;One major change when moving from workspace Model Registry to UC is using “aliases” over “stages” to promote models from development to production. When working with the workspace Model Registry, you would use MLflow model stages (None, Staging, Production, Archived) to progress models from the development stage (typically None) to testing (Staging) and then to production (Production). Once done with a model, you would move it to the “Archived” stage. However, in the UC world, the concept of stages is replaced by model aliases. You have aliases such as “Challenger” and “Champion” for models to be tested and in production, respectively.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H3&gt;&lt;SPAN&gt;How can I start using the MLflow Model Registry?&lt;/SPAN&gt;&lt;/H3&gt;
&lt;P&gt;&lt;SPAN&gt;You can use &lt;FONT face="courier new,courier"&gt;mlflow.register_model()&lt;/FONT&gt; to register any model you have logged during a run. Another option is to pass a “registered_model_name” argument when you are logging your model with &lt;FONT face="courier new,courier"&gt;mlflow.&amp;lt;MODEL_FLAVOR&amp;gt;.log_model()&lt;/FONT&gt;, and it will both log and register the model at the same time.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;To use UC as your model registry, all you need to do is:&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE class="highlight"&gt;&lt;SPAN&gt;import&lt;/SPAN&gt; &lt;SPAN&gt;mlflow&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;mlflow.set_registry_uri(&lt;/SPAN&gt;&lt;SPAN&gt;"databricks-uc"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Then use a 3-level namespace for your model names following the &lt;FONT face="courier new,courier"&gt;&amp;lt;CATALOG&amp;gt;.&amp;lt;SCHEMA&amp;gt;.&amp;lt;MODEL_NAME&amp;gt;&lt;/FONT&gt; pattern.&lt;/SPAN&gt;&lt;/P&gt;
&lt;H2&gt;&lt;SPAN&gt;End-to-end ML Experience with MLflow (Beginners version)&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Let’s look at a step-by-step experience using MLflow from experimentation through registering a model to Model Registry.&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Create a notebook and write your ML code in it (e.g. sklearn)&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Check the Experiments tab and explore your results by navigating to the experiment with the same name as your notebook. If you have multiple runs within the same experiment, you can select and compare their different metrics in the UI.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Decide which model is the “winner.” Then, use mlflow.register_model() to register it to the Model Registry.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI style="font-weight: 400;" aria-level="1"&gt;&lt;SPAN&gt;Load the model in a notebook using &lt;FONT face="courier new,courier"&gt;mlflow.&amp;lt;MODEL_FLAVOR&amp;gt;.load_model()&lt;/FONT&gt; and run inference.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;H2&gt;&lt;SPAN&gt;Coming up next!&lt;/SPAN&gt;&lt;/H2&gt;
&lt;P&gt;&lt;SPAN&gt;Next blog in this series: &lt;A href="https://community.databricks.com/t5/technical-blog/mlops-gym-unity-catalog-setup-for-mlops/ba-p/64943" target="_self"&gt;MLOps Gym - Unity Catalog Setup for MLOps&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2024 15:35:29 GMT</pubDate>
    <dc:creator>SepidehEb</dc:creator>
    <dc:date>2024-06-13T15:35:29Z</dc:date>
    <item>
      <title>MLOps Gym - Beginners Guide to MLflow</title>
      <link>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/ba-p/62593</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image (2).png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/6723i5627B0B8F6FA25C2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image (2).png" alt="image (2).png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2024 15:35:29 GMT</pubDate>
      <guid>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/ba-p/62593</guid>
      <dc:creator>SepidehEb</dc:creator>
      <dc:date>2024-06-13T15:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: MLOps Gym - Beginners Guide to MLflow</title>
      <link>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/bc-p/64770#M144</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/575"&gt;@SepidehEb&lt;/a&gt;&amp;nbsp; : Thank you for starting this series. I am new to MLOps and I found this post extremely educative. In fact I am looking for more clarity about promoting models in UC from Dev to staging to Prod through a CI/CD pipeline. Hope the upcoming posts will be insightful in that regard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again !&lt;/P&gt;&lt;P&gt;Nihar&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 09:16:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/bc-p/64770#M144</guid>
      <dc:creator>kumarnihar</dc:creator>
      <dc:date>2024-03-27T09:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: MLOps Gym - Beginners Guide to MLflow</title>
      <link>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/bc-p/64918#M146</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/102896"&gt;@kumarnihar&lt;/a&gt;&amp;nbsp;Thank you for the feedback. We are planning to publish more articles on CICD for MLOps in the Walk phase of the MLOps Gym in the coming months. You can also find a lot of good content in &lt;A href="https://www.databricks.com/resources/ebook/the-big-book-of-mlops?scid=7018Y000001Fi0oQAC&amp;amp;utm_medium=paid+search&amp;amp;utm_source=google&amp;amp;utm_campaign=17152786057&amp;amp;utm_adgroup=139126362889&amp;amp;utm_content=ebook&amp;amp;utm_offer=the-big-book-of-mlops&amp;amp;utm_ad=678212171657&amp;amp;utm_term=the%20big%20book%20of%20mlops&amp;amp;gad_source=1&amp;amp;gclid=Cj0KCQjwqpSwBhClARIsADlZ_TnTbvlb5JK0B524vHGwnQSATabO1u456q8X5VhZjzpyxd28nL6gfIcaAvqJEALw_wcB" target="_self"&gt;The Big Book of MLOps&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2024 14:59:18 GMT</pubDate>
      <guid>https://community.databricks.com/t5/technical-blog/mlops-gym-beginners-guide-to-mlflow/bc-p/64918#M146</guid>
      <dc:creator>SepidehEb</dc:creator>
      <dc:date>2024-03-28T14:59:18Z</dc:date>
    </item>
  </channel>
</rss>

