บทนำสู่ MLflow Model Registry

MLflow เบื้องต้น

Weston Bassler

Senior MLOps Engineer

วงจรชีวิตของโมเดล

แผนภาพของ development และ staging

MLflow เบื้องต้น

MLflow Model Registry

  • ที่เก็บข้อมูลส่วนกลาง

  • การจัดการวงจรชีวิต

    • Web UI
    • MLflow Client module
    • เวอร์ชันของโมเดล
    • Stage ของโมเดล

model-registry

MLflow เบื้องต้น

MLflow Model Registry

  • Model

    • โมเดลที่บันทึกลงใน MLflow Tracking
  • Registered Model

    • ได้รับหมายเลขเวอร์ชัน
    • พร้อมกำหนด Stage
MLflow เบื้องต้น

MLflow Model Registry

  • Model Version

    • เพิ่มขึ้นทุกครั้งที่ลงทะเบียนโมเดลใหม่
  • Model Stage

    • กำหนดได้เป็นหนึ่งใน:
      • None
      • Staging
      • Production
      • Archived

Stages

MLflow เบื้องต้น

การใช้งาน Model Registry

Models

MLflow เบื้องต้น

MLflow Client module

  • Experiments

  • Runs

  • Model Versions

  • Registered Models

Machine Learning

1 Flaticon.com
MLflow เบื้องต้น

การใช้งาน MLflow client module

# Import from MLflow module
from mlflow import MlflowClient


# Create an instance client = MlflowClient()
# Print the object client
<mlflow.tracking.client.MlflowClient object at 0x101d55f30>
MLflow เบื้องต้น

การลงทะเบียนโมเดล

# Create a Model named "Unicorn"
client.create_registered_model(name="Unicorn")
<RegisteredModel: creation_timestamp=1679404160448, description=None, 
last_updated_timestamp=1679404160448, latest_versions=[], name='Unicorn', 
tags={}>
MLflow เบื้องต้น

Model UI

create-model

MLflow เบื้องต้น

การค้นหา registered models

search-models

MLflow เบื้องต้น

การค้นหา registered models

# Search for registered models
client.search_registered_models(filter_string=MY_FILTER_STRING)
  • Identifiers
    • name - ชื่อของโมเดล
    • tags - tags ที่เชื่อมโยงกับโมเดล
  • Comparators
    • = - เท่ากับ
    • != - ไม่เท่ากับ
    • LIKE - จับคู่รูปแบบโดยคำนึงถึงตัวพิมพ์
    • ILIKE - จับคู่รูปแบบโดยไม่คำนึงถึงตัวพิมพ์
MLflow เบื้องต้น

ตัวอย่างการค้นหา

# Filter string
unicorn_filter_string = "name LIKE 'Unicorn%'"


# Search models client.search_registered_models(filter_string=unicorn_filter_string)
[<RegisteredModel: creation_timestamp=1679404160448, description=None, 
last_updated_timestamp=1679404160448, latest_versions=[], name='Unicorn', 
tags={}>, 
<RegisteredModel: creation_timestamp=1679404276745, description=None, 
last_updated_timestamp=1679404276745, latest_versions=[], name='Unicorn 2.0', 
tags={}>]
MLflow เบื้องต้น

มาฝึกกันเถอะ!

MLflow เบื้องต้น

Preparing Video For Download...