B2 - models, signatures and registration

import pickle

with open("model.pkl", "wb") as f:
    pickle.dump(model, f)
MLflow Model
├── model artifact
├── MLmodel metadata
├── model flavour(s)
├── signature
├── dependencies/environment information
└── other model metadata

eg: logging a scikit-learn model:

mlflow.sklearn.log_model(
    sk_model=model,
    name="model"
)

model flavours

model signatures

signature = infer_signature(
    X_train,
    model.predict(X_train)
)
MLflow Model
├── model
├── signature
└── input example

model resgistry

Registered Model v23
        │
        ▼
MLflow model
        │
        ▼
MLflow Run 83921
        ├── Git commit abc...
        ├── Data asset:v12
        ├── Environment:v5
        ├── Hyperparameters
        ├── Metrics
        └── Artifacts
Training Job
     ↓
MLflow Run
     ↓
log parameters
log metrics
log model
     ↓
Candidate
     ↓
Quality Gates
     │
     ├── F1 ≥ threshold?
     ├── Recall ≥ threshold?
     ├── Signature valid?
     └── other checks?
     ↓
REGISTER
     ↓
Registered Model:vN
     ↓
staging/testing
     ↓
DEPLOY