MLFlow Projekte Modul
MLflow Projekte können auch programmatisch mit Python ausgeführt werden, indem du das Modul mlflow projects
verwendest.
In dieser Übung führst du ein MLflow Projekt mit dem Modul projects
aus, um ein Modell für dein "Insurance"
Projekt zu trainieren. Du definierst den Einstiegspunkt in deiner MLproject
Datei, um den Trainingscode auszuführen. Du legst auch den Namen des Experiments "Insurance"
fest, damit das Modell im MLflow Tracking dem richtigen Experiment zugeordnet werden kann.
Du kannst den Inhalt der Datei MLproject
lesen, indem du print(MLproject)
in der Shell IPython ausführst.
Diese Übung ist Teil des Kurses
Einführung in MLflow
Anleitung zur Übung
- Rufe die Funktion
run()
aus dem Modulmlflow projects
auf. - Setze die URI für die Datei
MLproject
auf das aktuelle Arbeitsverzeichnis. - Setze den Einstiegspunkt auf
"main"
gemäß der DateiMLproject
. - Setze den Namen des Experiments auf
"Insurance"
.
Interaktive Übung
Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.
import mlflow
# Set the run function from the MLflow Projects module
____.____.____(
# Set the URI as the current working directory
____='____',
# Set the entry point to main
____='____',
# Set the experiment name as Insurance
____='____',
env_manager="local",
synchronous=True,
)