<?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>topic Re: When does everyone utilize the model register? in Machine Learning</title>
    <link>https://community.databricks.com/t5/machine-learning/when-does-everyone-utilize-the-model-register/m-p/129176#M4246</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/93088"&gt;@Yuki&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for contacting the Databricks community.&lt;/P&gt;
&lt;UL data-start="1909" data-end="2441"&gt;
&lt;LI data-start="1909" data-end="2024"&gt;
&lt;P data-start="1911" data-end="2024"&gt;If you run &lt;CODE data-start="1922" data-end="1938"&gt;register_model&lt;/CODE&gt; with the same run twice, you’ll create multiple versions pointing to the same source.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="2025" data-end="2441"&gt;
&lt;P data-start="2027" data-end="2119"&gt;To avoid that, you can check if the run is already registered before creating a new version:&lt;/P&gt;
&lt;DIV class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"&gt;
&lt;DIV class="sticky top-9"&gt;
&lt;DIV class="absolute end-0 bottom-0 flex h-9 items-center pe-2"&gt;
&lt;DIV class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;CODE class="whitespace-pre! language-python"&gt;&lt;CODE class="whitespace-pre! language-python"&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;LI-CODE lang="python"&gt;from mlflow.tracking import MlflowClient

client = MlflowClient()
existing = [
    v.source for v in client.search_model_versions(f"name='{model_name}'")
]
if f"runs:/{best_run.run_id}/model" not in existing:
    result = mlflow.register_model(f"runs:/{best_run.run_id}/model", model_name)&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;CODE class="whitespace-pre! language-python"&gt;&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Thu, 21 Aug 2025 19:52:39 GMT</pubDate>
    <dc:creator>Kumaran</dc:creator>
    <dc:date>2025-08-21T19:52:39Z</dc:date>
    <item>
      <title>When does everyone utilize the model register?</title>
      <link>https://community.databricks.com/t5/machine-learning/when-does-everyone-utilize-the-model-register/m-p/115820#M4029</link>
      <description>&lt;P&gt;Hi, I'm Yuki,&lt;/P&gt;&lt;P&gt;I'm considering when I should use register_model.&lt;/P&gt;&lt;P&gt;In my case, I'm running the training batch once a week and if the model is good, I want to update the champion.&lt;/P&gt;&lt;P&gt;I have created the code to register the model if the score is the best.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# start run
with mlflow.start_run():
    clf = RandomForestRegressor(n_estimators=100)
    clf.fit(X, y)
    # log model to the run
    mlflow.sklearn.log_model(sk_model=clf)

# search best model of all runs
best_run = mlflow.search_runs([experiment_id], order_by=["metric.test_f1 DESC"]).iloc[0]
# register model
result = mlflow.register_model(f"runs:/{best_run.run_id}/model", model_name)
# create "Champion" alias for the best version
client = MlflowClient()
client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", result.version)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This can avoid registering many models in the model registry, keeping it clean.&lt;/P&gt;&lt;P&gt;But I feel that the code is not perfect and seems strange.&lt;/P&gt;&lt;P&gt;First, in the &lt;A href="https://docs.databricks.com/gcp/en/machine-learning/manage-model-lifecycle/" target="_self"&gt;documents&lt;/A&gt;, we can register the model every time easily and smoothly like below.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;    mlflow.sklearn.log_model(
        sk_model=clf,
        artifact_path="model",
        # The signature is automatically inferred from the input example and its predicted output.
        input_example=input_example,
        registered_model_name="prod.ml_team.iris_model",
    )&lt;/LI-CODE&gt;&lt;P&gt;When is the case to use?&lt;/P&gt;&lt;P&gt;Second, my code may create duplicates of models or source runs. Of course, I can check for duplicates before registering the model, but I feel my lack of knowledge. If I want to achieve the purpose, I can use mlflow.search_runs([experiment_id], order_by=["metric.test_f1 DESC"]).iloc[0] every time and no need for registration.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't grasp the core idea of model registry.&lt;/P&gt;&lt;P&gt;How does everyone do that?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 05:37:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/when-does-everyone-utilize-the-model-register/m-p/115820#M4029</guid>
      <dc:creator>Yuki</dc:creator>
      <dc:date>2025-04-18T05:37:47Z</dc:date>
    </item>
    <item>
      <title>Re: When does everyone utilize the model register?</title>
      <link>https://community.databricks.com/t5/machine-learning/when-does-everyone-utilize-the-model-register/m-p/129176#M4246</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/93088"&gt;@Yuki&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Thank you for contacting the Databricks community.&lt;/P&gt;
&lt;UL data-start="1909" data-end="2441"&gt;
&lt;LI data-start="1909" data-end="2024"&gt;
&lt;P data-start="1911" data-end="2024"&gt;If you run &lt;CODE data-start="1922" data-end="1938"&gt;register_model&lt;/CODE&gt; with the same run twice, you’ll create multiple versions pointing to the same source.&lt;/P&gt;
&lt;/LI&gt;
&lt;LI data-start="2025" data-end="2441"&gt;
&lt;P data-start="2027" data-end="2119"&gt;To avoid that, you can check if the run is already registered before creating a new version:&lt;/P&gt;
&lt;DIV class="contain-inline-size rounded-2xl relative bg-token-sidebar-surface-primary"&gt;
&lt;DIV class="sticky top-9"&gt;
&lt;DIV class="absolute end-0 bottom-0 flex h-9 items-center pe-2"&gt;
&lt;DIV class="bg-token-bg-elevated-secondary text-token-text-secondary flex items-center gap-4 rounded-sm px-2 font-sans text-xs"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;CODE class="whitespace-pre! language-python"&gt;&lt;CODE class="whitespace-pre! language-python"&gt;&lt;/CODE&gt;&lt;/CODE&gt;&lt;LI-CODE lang="python"&gt;from mlflow.tracking import MlflowClient

client = MlflowClient()
existing = [
    v.source for v in client.search_model_versions(f"name='{model_name}'")
]
if f"runs:/{best_run.run_id}/model" not in existing:
    result = mlflow.register_model(f"runs:/{best_run.run_id}/model", model_name)&lt;/LI-CODE&gt;&lt;/DIV&gt;
&lt;DIV class="overflow-y-auto p-4" dir="ltr"&gt;&lt;CODE class="whitespace-pre! language-python"&gt;&lt;/CODE&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 21 Aug 2025 19:52:39 GMT</pubDate>
      <guid>https://community.databricks.com/t5/machine-learning/when-does-everyone-utilize-the-model-register/m-p/129176#M4246</guid>
      <dc:creator>Kumaran</dc:creator>
      <dc:date>2025-08-21T19:52:39Z</dc:date>
    </item>
  </channel>
</rss>

