From ef49d9919c4825210f9d287eb90621728e9369c0 Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Mon, 9 Dec 2019 09:46:27 -0500 Subject: [PATCH 1/7] Update azdo-ci-build-train.yml for Azure Pipelines --- .pipelines/azdo-ci-build-train.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pipelines/azdo-ci-build-train.yml b/.pipelines/azdo-ci-build-train.yml index d1d95843..3dcc56bb 100644 --- a/.pipelines/azdo-ci-build-train.yml +++ b/.pipelines/azdo-ci-build-train.yml @@ -36,6 +36,7 @@ stages: # Invoke the Python building and publishing a training pipeline python $(Build.SourcesDirectory)/ml_service/pipelines/${{ variables.BUILD_TRAIN_SCRIPT }} displayName: 'Publish Azure Machine Learning Pipeline' + - stage: 'Trigger_AML_Pipeline' displayName: 'Train, evaluate, register model via previously published AML pipeline' jobs: @@ -84,6 +85,8 @@ stages: PipelineId: '$(AMLPIPELINE_ID)' ExperimentName: '$(EXPERIMENT_NAME)' PipelineParameters: '"ParameterAssignments": {"model_name": "$(MODEL_NAME)", "hyperparameter_alpha": "$(ALPHA)"}' + + - job: "Training_Run_Report" dependsOn: "Run_ML_Pipeline" displayName: "Determine if evaluation succeeded and new model is registered" From 36b37359f7c1139b67f6d1b65d23bb853dd7da7f Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Mon, 16 Dec 2019 11:51:28 -0500 Subject: [PATCH 2/7] Update train.py --- code/training/train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/code/training/train.py b/code/training/train.py index 05c58683..c9f3f346 100644 --- a/code/training/train.py +++ b/code/training/train.py @@ -33,6 +33,7 @@ from sklearn.externals import joblib + def train_model(run, data, alpha): run.log("alpha", alpha) run.parent.log("alpha", alpha) From 61392f9ddfd7bdc57bcb457c859c9d58521dee86 Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Sun, 9 Feb 2020 20:19:35 -0500 Subject: [PATCH 3/7] Update train.py --- code/training/train.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/training/train.py b/code/training/train.py index c9f3f346..a691f5b2 100644 --- a/code/training/train.py +++ b/code/training/train.py @@ -32,8 +32,6 @@ from sklearn.model_selection import train_test_split from sklearn.externals import joblib - - def train_model(run, data, alpha): run.log("alpha", alpha) run.parent.log("alpha", alpha) From fc6e52fb8ee3199146228443660225a9e5ac9f80 Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Sun, 9 Feb 2020 20:32:38 -0500 Subject: [PATCH 4/7] Update train.py --- code/training/train.py | 1 + 1 file changed, 1 insertion(+) diff --git a/code/training/train.py b/code/training/train.py index a691f5b2..05c58683 100644 --- a/code/training/train.py +++ b/code/training/train.py @@ -32,6 +32,7 @@ from sklearn.model_selection import train_test_split from sklearn.externals import joblib + def train_model(run, data, alpha): run.log("alpha", alpha) run.parent.log("alpha", alpha) From ecea9af26e5aefb34ab00c2491562a7c36d5d66c Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Sun, 9 Feb 2020 20:39:48 -0500 Subject: [PATCH 5/7] Update code_test.py --- tests/unit/code_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/code_test.py b/tests/unit/code_test.py index 06654b2f..750fada9 100644 --- a/tests/unit/code_test.py +++ b/tests/unit/code_test.py @@ -18,7 +18,7 @@ def test_train_model(): run = Mock(Run) reg = train_model(run, data, alpha=1.2) - run.log.assert_called_with("mse", 0.029843893480256872, + run.log.assert_called_with("mse", 0.029843893480257067, description='Mean squared error metric') preds = reg.predict([[1], [2]]) From 6c7a774e5db17ccad8fded66113036730653dcf9 Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Mon, 10 Feb 2020 19:15:44 -0500 Subject: [PATCH 6/7] Always register new model --- code/evaluate/evaluate_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/evaluate/evaluate_model.py b/code/evaluate/evaluate_model.py index f59a87fd..f4291304 100644 --- a/code/evaluate/evaluate_model.py +++ b/code/evaluate/evaluate_model.py @@ -131,7 +131,7 @@ else: print("New trained model metric is less than or equal to " "production model so skipping model registration.") - run.parent.cancel() + # run.parent.cancel() else: print("This is the first model, " "thus it should be registered") From 3134d7c6a4146eb1c9322c87dab6637b6e723dc4 Mon Sep 17 00:00:00 2001 From: Alexander Slotte Date: Fri, 21 Feb 2020 10:31:33 -0500 Subject: [PATCH 7/7] Update conda_dependencies.yml --- code/scoring/conda_dependencies.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/scoring/conda_dependencies.yml b/code/scoring/conda_dependencies.yml index 41a05694..e2ac63b4 100644 --- a/code/scoring/conda_dependencies.yml +++ b/code/scoring/conda_dependencies.yml @@ -28,9 +28,9 @@ dependencies: - azureml-model-management-sdk==1.0.1b6.post1 - azureml-sdk==1.0.74 - scipy==1.3.1 - - scikit-learn==0.21.3 - - pandas==0.25.3 - - numpy==1.17.3 + - scikit-learn==0.22.1 + - pandas==1.0.0 + - numpy==1.18.1 - joblib==0.14.0 - gunicorn==19.9.0 - flask==1.1.1