Modul „MLflow projects“
MLflow Projects lassen sich auch programmatisch mit Python über das Modul mlflow projects ausführen.
In dieser Übung führst du ein MLflow Project mithilfe des projects-Moduls aus, um für dein "Insurance"-Projekt ein Modell zu trainieren. Du legst den Entry-Point aus deiner MLproject-Datei fest, um den Trainingscode auszuführen. Außerdem setzt du den Experimentnamen auf "Insurance", damit das Modell im richtigen Experiment in MLflow Tracking protokolliert wird.
Du kannst den Inhalt der Datei MLproject anzeigen, indem du print(MLproject) in der IPython-Shell ausführst.
Diese Übung ist Teil des Kurses
Einführung in MLflow
Anleitung zur Übung
- Rufe die Funktion
run()aus dem Modulmlflow projectsauf. - Setze die URI für die Datei
MLprojectauf das aktuelle Arbeitsverzeichnis. - Setze den Entry-Point gemäß der
MLproject-Datei auf"main". - Setze den Experimentnamen auf
"Insurance".
Interaktive Übung
Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.
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,
)