Machine Learning on Kubernetes by Faisal Masood Ross Brigoli

Machine Learning on Kubernetes by Faisal Masood Ross Brigoli

Author:Faisal Masood, Ross Brigoli
Language: eng
Format: epub
Publisher: Packt Publishing Limited
Published: 2022-05-20T00:00:00+00:00


Figure 6.26 – MLflow customized data collection notebook

Let's understand these functions in the next few steps. The code snippet in code cell number 6 is as follows:

with mlflow.start_run(tags={ "mlflow.source.git.commit" : mlflow_util.get_git_revision_hash() , "mlflow.source.git.branch": mlflow_util.get_git_branch(), "code.repoURL": mlflow_util.get_git_remote() }) as run: model.fit(X, y) mlflow_util.record_libraries(mlflow) mlflow_util.log_metric(mlflow, "custom_mteric", 1.0) mlflow_util.log_param(mlflow, "docker_image_name", os.environ["JUPYTER_IMAGE"])

The preceding code will include a custom tag labeled code.repoURL. This makes it easier to trace back the original source code that produced the model in a given experiment run.

You can associate any tags while calling the start_run function. Tag keys that start with mlflow are reserved for internal use. You can see that we have associated the GIT commit hash with the first property. This will help us in following through on what experiment belongs to what code version in your code repository.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.