0Pricing
MLOps Academy · 课时

注册您的第一个模型版本

将训练好的模型推送到 MLflow 模型注册表

注册您的第一个模型版本 是 CoddyKit 上的免费 MLOps Academy 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 MLOps Academy 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 MLOps Academy 课程共包含 4 节课。

本课时的部分内容尚未翻译,以英文显示。

What a Registry Is

A model registry is a central catalog for your trained models. Instead of files scattered on laptops, every model lives in one place with a version number. 📚

Runs vs Registered Models

An MLflow run records one training attempt. A registered model is a named entry that points at the best run you choose to promote and keep.

Log Before You Register

You always log a model first inside a run. Logging saves the artifact so the registry has something concrete to point back at later.

import mlflow
with mlflow.start_run():
    mlflow.sklearn.log_model(model, "model")

Register in One Call

The fastest path is the registered_model_name argument. Pass it to log_model and MLflow creates the registry entry and a first version for you.

mlflow.sklearn.log_model(
    model, "model",
    registered_model_name="churn-classifier")

Versions Start at 1

Your first registration becomes version 1. Every later registration under the same name bumps the version automatically, so history is never overwritten.

Register From a Past Run

Already logged a model? You can register it after the fact by pointing at its run URI with mlflow.register_model.

mlflow.register_model(
    "runs:/<run_id>/model",
    "churn-classifier")

The runs URI

That runs:/ URI is how MLflow finds the artifact. It combines the run id and the artifact path you used when you logged the model.

The Tracking URI

Set the tracking URI so your code talks to the right server. Without it, MLflow registers everything to a local mlruns folder instead.

mlflow.set_tracking_uri(
    "http://localhost:5000")

See It in the UI

Open the MLflow UI and click the Models tab. Your new model name appears there with version 1 listed under it, ready to inspect.

Names Are Identifiers

Pick a clear, stable name like fraud-detector. Teammates and code load models by that name, so renaming later breaks everything pointing at it.

Confirm With the Client

The MlflowClient lets you verify registration in code. Fetch the model by name and read back the versions that exist.

from mlflow import MlflowClient
c = MlflowClient()
print(c.get_registered_model("churn-classifier"))

Quick Check

Let us check how a first registration is numbered.

Recap

You logged a model, gave it a registry name, and got version 1. Now your best model has a home that anyone on the team can find. 🎉

常见问题解答

「注册您的第一个模型版本」课时是免费的吗?

是的 — 「注册您的第一个模型版本」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 MLOps Academy 课程的其余内容,请升级到 CoddyKit PRO。 MLOps Academy 课程共包含 4 节课。

「注册您的第一个模型版本」这节课中我会学到什么?

将训练好的模型推送到 MLflow 模型注册表 你通过在浏览器中直接运行的动手代码来练习 MLOps Academy,全天候 AI 导师会在你学习这节课的过程中回答你的问题。

学习 MLOps Academy 需要有经验吗?

无需任何先前经验。CoddyKit 上的 MLOps Academy 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。

「注册您的第一个模型版本」课时需要多长时间?

大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。

我能在这节 MLOps Academy 课中编写并运行代码吗?

能。每节 MLOps Academy 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。

此课程中的所有课时

  1. 注册您的第一个模型版本
  2. 阶段:暂存、生产、归档
  3. 为模型添加标签和描述
  4. 按名称和阶段重新加载模型
← 返回 MLOps Academy