Quy trình làm việc

Giới thiệu về MLflow

Weston Bassler

Senior MLOps Engieer

MLflow Projects

Quy trình làm việc

1 unsplash.com
Giới thiệu về MLflow

MLproject

name: project_name
python_env: python_env.yaml
entry_points:

step_1: command: "python train_model.py"
step_2: command: "python evaluate_model.py {run_id}" parameters: run_id: type: str default: None
Giới thiệu về MLflow

Quy trình làm việc

import mlflow

# Bước 1
step_1 = mlflow.projects.run(
    uri='./',
    entry_point='step_1'
)

# Bước 2 step_2 = mlflow.projects.run( uri='./', entry_point='step_2' )
Giới thiệu về MLflow

Chạy Projects

import mlflow

# Bước 1
step_1 = mlflow.projects.run(
    uri='./',
    entry_point='step_1'
)

print(step_1)
<mlflow.projects.submitted_run.LocalSubmittedRun object at 0x125eac8b0>
Giới thiệu về MLflow

Chạy Projects

step_1.cancel() - Dừng lượt chạy hiện tại

step_1.get_status() - Lấy trạng thái lượt chạy

step_1.run_id - run_id của lượt chạy

step_1.wait() - Chờ lượt chạy kết thúc

Giới thiệu về MLflow

Chạy Projects

import mlflow

# Bước 1
step_1 = mlflow.projects.run(
    uri='./',
    entry_point='step_1'
)

# Tạo biến lưu run_id của step_1 step_1_run_id = step_1.run_id
# Bước 2
step_2 = mlflow.projects.run(
    uri='./',
    entry_point='step_2',

parameters={ 'run_id': step_1_run_id }
)
Giới thiệu về MLflow

Vòng đời ML

Kỹ thuật Mô hình và Đánh giá Mô hình

Giới thiệu về MLflow

Hãy thực hành!

Giới thiệu về MLflow

Preparing Video For Download...