0Pricing
MLOps Academy · บทเรียน

รูปแบบโมเดลของ MLflow

จัดแพ็กเกจโมเดลพร้อม Dependencies และลายเซ็นของโมเดล

รูปแบบโมเดลของ MLflow เป็นบทเรียน MLOps Academy ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน MLOps Academy และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

Beyond a Raw File

A bare pickle is just bytes. MLflow wraps your model in a self-describing folder so anyone can load it without guessing how. 📦

What Is a Flavor?

An MLflow flavor is a known format, like sklearn or pytorch, that tells MLflow exactly how to save and load that model.

One Model, Many Flavors

A single saved model can carry several flavors. That lets different tools load it their own way from the same artifact.

Save with a Flavor

Use the matching module to log a model. For scikit-learn you call mlflow.sklearn.log_model inside a run.

import mlflow.sklearn
mlflow.sklearn.log_model(model, name='model')

The MLmodel File

Every saved model has an MLmodel YAML file listing its flavors, signature, and how to reload it. It is the model's ID card.

Dependencies Travel Too

MLflow records the libraries your model needs in a conda.yaml or requirements file, so the same environment can be rebuilt later.

The pyfunc Flavor

Most models also get the universal pyfunc flavor. It exposes one simple predict call, no matter the framework underneath. 🔑

Load as pyfunc

Loading via pyfunc gives you a generic object with predict, so your serving code stays the same across frameworks.

import mlflow.pyfunc
m = mlflow.pyfunc.load_model('runs:/<id>/model')
m.predict(X)

Load Back Native

You can also reload in the original framework with the matching loader, getting the full native object instead of the generic wrapper.

model = mlflow.sklearn.load_model('runs:/<id>/model')

Custom pyfunc Models

No built-in flavor fits? Subclass PythonModel and write your own predict to wrap any logic into the pyfunc format.

class MyModel(mlflow.pyfunc.PythonModel):
    def predict(self, ctx, X):
        return self.run(X)

Why It Matters

Flavors make a model truly portable: training, registry, and serving all speak the same format without bespoke glue code.

Quick Check

Let's check your grasp of MLflow flavors.

Recap

An MLflow model is a self-describing folder with flavors, an MLmodel file, and pinned deps, loadable natively or as universal pyfunc. 🎉

คำถามที่พบบ่อย

บทเรียน “รูปแบบโมเดลของ MLflow” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “รูปแบบโมเดลของ MLflow” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส MLOps Academy ให้อัปเกรดเป็น CoddyKit PRO คอร์ส MLOps Academy มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “รูปแบบโมเดลของ MLflow”

จัดแพ็กเกจโมเดลพร้อม Dependencies และลายเซ็นของโมเดล คุณปฏิบัติ MLOps Academy ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน MLOps Academy หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน MLOps Academy บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน

บทเรียน “รูปแบบโมเดลของ MLflow” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน MLOps Academy นี้ได้ไหม

ได้ บทเรียน MLOps Academy ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. ทำซีเรียลไลซ์ด้วย Pickle และ Joblib
  2. รูปแบบโมเดลของ MLflow
  3. ส่งออกเป็น ONNX เพื่อการใช้งานข้ามระบบ
  4. กำหนดลายเซ็นและสคีมาของโมเดล
← กลับไปที่ MLOps Academy