From 6e0b40f36481c96d24e7c003a80bc50f24d6b91c Mon Sep 17 00:00:00 2001 From: Jens Humrich Date: Mon, 25 Oct 2021 16:48:16 +0200 Subject: [PATCH 1/3] update documentation --- docs/code_description.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/code_description.md b/docs/code_description.md index d30295e9..81abc78f 100644 --- a/docs/code_description.md +++ b/docs/code_description.md @@ -52,8 +52,8 @@ The repository provides a template with folders structure suitable for maintaini - `.pipelines/code-quality-template.yml` : a pipeline template used by the CI and PR pipelines. It contains steps performing linting, data and unit testing. - `.pipelines/diabetes_regression-ci-image.yml` : a pipeline building a scoring image for the diabetes regression model. - `.pipelines/diabetes_regression-ci.yml` : a pipeline triggered when the code is merged into **master**. It performs linting, data integrity testing, unit testing, building and publishing an ML pipeline. -- `.pipelines/diabetes_regression-cd.yml` : a pipeline triggered when the code is merged into **master** and the `.pipelines/diabetes_regression-ci.yml` completes. It performs linting, data integrity testing, unit testing, building and publishing an ML pipeline. -- `.pipelines/diabetes_regression-package-model-template.yml` : a pipeline triggered when the code is merged into **master**. It deploys the registered model to a target. +- `.pipelines/diabetes_regression-cd.yml` : a pipeline triggered when the code is merged into **master** and the `.pipelines/diabetes_regression-ci.yml` completes. Deploys the model to ACI, AKS or Webapp. +- `.pipelines/diabetes_regression-package-model-template.yml` : Pipeline template that creates a model package and adds the package location to the environment for subsequent tasks to use. - `.pipelines/diabetes_regression-get-model-id-artifact-template.yml` : a pipeline template used by the `.pipelines/diabetes_regression-cd.yml` pipeline. It takes the model metadata artifact published by the previous pipeline and gets the model ID. - `.pipelines/diabetes_regression-publish-model-artifact-template.yml` : a pipeline template used by the `.pipelines/diabetes_regression-ci.yml` pipeline. It finds out if a new model was registered and publishes a pipeline artifact containing the model metadata. - `.pipelines/helm-*.yml` : pipeline templates used by the `.pipelines/abtest.yml` pipeline. @@ -84,11 +84,11 @@ The repository provides a template with folders structure suitable for maintaini ### Evaluation Step -- `diabetes_regression/evaluate/evaluate_model.py` : an evaluating step of an ML training pipeline which registers a new trained model if evaluation shows the new model is more performant than the previous one. +- `diabetes_regression/evaluate/evaluate_model.py` : an evaluating step which cancels the pipeline in case of non-improvement. ### Registering Step -- `diabetes_regression/evaluate/register_model.py` : registers a new trained model if evaluation shows the new model is more performant than the previous one. +- `diabetes_regression/register/register_model.py` : registers a new trained model if evaluation shows the new model is more performant than the previous one. ### Scoring From 391d4460bee49874a7560de00cc8f4d7530c792a Mon Sep 17 00:00:00 2001 From: Jens Humrich Date: Wed, 27 Oct 2021 17:05:11 +0200 Subject: [PATCH 2/3] fix evaluate issue --- diabetes_regression/evaluate/evaluate_model.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/diabetes_regression/evaluate/evaluate_model.py b/diabetes_regression/evaluate/evaluate_model.py index 5a69addb..74e99897 100644 --- a/diabetes_regression/evaluate/evaluate_model.py +++ b/diabetes_regression/evaluate/evaluate_model.py @@ -118,17 +118,21 @@ production_model_mse = 10000 if (metric_eval in model.tags): production_model_mse = float(model.tags[metric_eval]) - new_model_mse = float(run.parent.get_metrics().get(metric_eval)) + try: + new_model_mse = float(run.parent.get_metrics().get(metric_eval)) + except TypeError: + new_model_mse = None if (production_model_mse is None or new_model_mse is None): - print("Unable to find", metric_eval, "metrics, " + print("Unable to find ", metric_eval, " metrics, " "exiting evaluation") if((allow_run_cancel).lower() == 'true'): run.parent.cancel() else: print( - "Current Production model mse: {}, " - "New trained model mse: {}".format( - production_model_mse, new_model_mse + "Current Production model {metric_eval}: {}, " + "New trained model {metric_eval}: {}".format( + metric_eval, production_model_mse, + metric_eval, new_model_mse ) ) From 432c4b96b3ddcbe29aa6e0c8bcc246766e5d715a Mon Sep 17 00:00:00 2001 From: Jens Humrich Date: Wed, 27 Oct 2021 18:54:18 +0200 Subject: [PATCH 3/3] linting --- diabetes_regression/evaluate/evaluate_model.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diabetes_regression/evaluate/evaluate_model.py b/diabetes_regression/evaluate/evaluate_model.py index 74e99897..d1ff3c6a 100644 --- a/diabetes_regression/evaluate/evaluate_model.py +++ b/diabetes_regression/evaluate/evaluate_model.py @@ -129,9 +129,9 @@ run.parent.cancel() else: print( - "Current Production model {metric_eval}: {}, " - "New trained model {metric_eval}: {}".format( - metric_eval, production_model_mse, + "Current Production model {}: {}, ".format( + metric_eval, production_model_mse) + + "New trained model {}: {}".format( metric_eval, new_model_mse ) )