Das MLflow Model Flavor
Bündeln Sie Modelle mit ihren Abhängigkeiten und ihrer Signatur.
Das MLflow Model Flavor ist eine kostenlose MLOps Academy-Lektion auf CoddyKit. Dies ist Lektion 2 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des MLOps Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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. 🎉
Häufig gestellte Fragen
Ist die Lektion „Das MLflow Model Flavor“ kostenlos?
Ja — der vollständige Text von „Das MLflow Model Flavor“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des MLOps Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der MLOps Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Das MLflow Model Flavor“?
Bündeln Sie Modelle mit ihren Abhängigkeiten und ihrer Signatur. Du übst MLOps Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um MLOps Academy zu starten?
Keine Vorkenntnisse erforderlich. MLOps Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 2 von 4.
Wie lange dauert die Lektion „Das MLflow Model Flavor“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser MLOps Academy-Lektion Code schreiben und ausführen?
Ja. Jede MLOps Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Mit Pickle und Joblib serialisieren
- Das MLflow Model Flavor
- Für Portabilität nach ONNX exportieren
- Eine Modellsignatur und ein Schema definieren