-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new files due to change in Azure udacity account
- Loading branch information
1 parent
92d0bb0
commit 475adb3
Showing
12 changed files
with
67 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,65 @@ | ||
*NOTE:* This file is a template that you can use to create the README for your project. The *TODO* comments below will highlight the information you should be sure to include. | ||
|
||
|
||
# Your Project Title Here | ||
# Project Title: Operationalizing Machine Learning | ||
|
||
Project Overview: | ||
- Dataset used: Bank Marketing dataset. | ||
- I use Azure to configure a cloud-based ML production model, deploy it, and consume it. | ||
- I create, publish, and consume a pipeline. | ||
- I demonstrate all my work by creating a README file and a screencast video. | ||
|
||
*TODO:* Write an overview to your project. | ||
|
||
## Architectural Diagram | ||
*TODO*: Provide an architectual diagram of the project and give an introduction of each step. An architectural diagram is an image that helps visualize the flow of operations from start to finish. In this case, it has to be related to the completed project, with its various stages that are critical to the overall flow. For example, one stage for managing models could be "using Automated ML to determine the best model". | ||
|
||
## Key Steps | ||
*TODO*: Write a short discription of the key steps. Remeber to include all the screenshots required to demonstrate key steps. | ||
*TODO*: include all the screenshots | ||
Step 1: Authentication | ||
- I skipped this step since I used Udacity Lab and thus could not create a Service Principal | ||
|
||
Step 2: Auto ML Experiment | ||
- Upload data (csv file) to default datastore in Azure ML studio, and register a dataset | ||
- Create a compute instance to be used by the jupyter notebook later | ||
- Create a compute cluster to be used by the AutoML experiment with min nodes as 1, and max nodes as 5 | ||
- Create an AutoML experiment with the above dataset and compute cluster | ||
<img src="screenshots/registered_dataset.png"> | ||
<img src="screenshots/experiment_completed.png"> | ||
<img src="screenshots/best_model_voting_ensemble.png"> | ||
|
||
Step 3: Deploy Best Model | ||
- Once AutoML experiment completes, deploy the best model on ACI with authentication enabled | ||
|
||
Step 4: Enable Logging | ||
- Create a python virtual/conda environment with libraries required to run the scripts. Activate it. | ||
- Download config.json from Azure ML portal and store in same folder as logs.py | ||
- In logs.py, insert the deployment name. From terminal, run "python logs.py" to enable logging | ||
<img src="screenshots/app_insights_enabled.png"> | ||
<img src="screenshots/logs_screenshot.png"> | ||
|
||
Step 5: Swagger Documentation | ||
- Copy the swagger.json URL from the deployment, use wget to download file inside 'swagger' folder | ||
- From /swagger directory, run "bash swagger.sh" to launch docker in localhost port 10000. You can view swagger UI in localhost:10000. | ||
- Run "python serve.py", and insert "http://localhost:8000/swagger.json" in the search bar in Swagger UI. This will show the /score endpoint | ||
<img src="screenshots/swagger_http_endpoints_localhost.png"> | ||
|
||
Step 6: Consume Model Endpoint | ||
- In endpoint.py, insert the scoring_uri and key from the deployment, and run "python endpoint.py" | ||
- Benchmark endpoint: Check if Apache Benchmark is installed. In benchmark.sh, insert appropriate key and scoring_uri and run "bash benchmark.sh" | ||
<img src="screenshots/endpoint_script_json_output.png"> | ||
<img src="screenshots/benchmark_results.png"> | ||
|
||
Step 7: Create, Publish, Consume Pipeline | ||
- Run the cells in the aml-pipelines-with-automated-machine-learning-step.ipynb notebook after inserting the right cluster name, experiment name, dataset name. This would create and publish pipeline. | ||
<img src="screenshots/pipeline_created.png"> | ||
<img src="screenshots/pipeline_endpoint.png"> | ||
<img src="screenshots/bank_dataset_with_automl_module.png"> | ||
<img src="screenshots/published_pipeline_overview_status_active.png"> | ||
<img src="screenshots/run_details_widget_step_runs.png"> | ||
|
||
|
||
## Screen Recording | ||
*TODO* Provide a link to a screen recording of the project in action. Remember that the screencast should demonstrate: | ||
|
||
## Standout Suggestions | ||
*TODO (Optional):* This is where you can provide information about any standout suggestions that you have attempted. | ||
- Performed the Model Endpoint's benchmarking using Apache Benchmark (though it was optional) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"subscription_id": "3e42d11f-d64d-4173-af9b-12ecaa1030b3", | ||
"resource_group": "aml-quickstarts-207494", | ||
"workspace_name": "quick-starts-ws-207494" | ||
"subscription_id": "48a74bb7-9950-4cc1-9caa-5d50f995cc55", | ||
"resource_group": "aml-quickstarts-207816", | ||
"workspace_name": "quick-starts-ws-207816" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"swagger": "2.0", "info": {"title": "best-bankmarketing-model", "description": "API specification for the Azure Machine Learning service best-bankmarketing-model", "version": "1.0"}, "schemes": ["https"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Bearer": {"type": "apiKey", "name": "Authorization", "in": "header", "description": "For example: Bearer abc123"}}, "paths": {"/": {"get": {"operationId": "ServiceHealthCheck", "description": "Simple health check endpoint to ensure the service is up at any given point.", "responses": {"200": {"description": "If service is up and running, this response will be returned with the content 'Healthy'", "schema": {"type": "string"}, "examples": {"application/json": "Healthy"}}, "default": {"description": "The service failed to execute due to an error.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/score": {"post": {"operationId": "RunMLService", "description": "Run web service's model and get the prediction output", "security": [{"Bearer": []}], "parameters": [{"name": "serviceInputPayload", "in": "body", "description": "The input payload for executing the real-time machine learning service.", "schema": {"$ref": "#/definitions/ServiceInput"}}], "responses": {"200": {"description": "The service processed the input correctly and provided a result prediction, if applicable.", "schema": {"$ref": "#/definitions/ServiceOutput"}}, "default": {"description": "The service failed to execute due to an error.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/swagger.json": {"get": {"operationId": "GetSwaggerSpec", "description": "Get the Swagger specification.", "parameters": [{"name": "version", "in": "query", "required": false, "type": "integer", "enum": [2, 3]}], "responses": {"200": {"description": "The Swagger specification.", "schema": {"type": "string"}}, "default": {"description": "The service failed to execute due to an error.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}}, "definitions": {"ServiceInput": {"type": "object", "properties": {"Inputs": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"type": "object", "required": ["age", "job", "marital", "education", "default", "housing", "loan", "contact", "month", "day_of_week", "duration", "campaign", "pdays", "previous", "poutcome", "emp.var.rate", "cons.price.idx", "cons.conf.idx", "euribor3m", "nr.employed"], "properties": {"age": {"type": "integer", "format": "int64"}, "job": {"type": "string"}, "marital": {"type": "string"}, "education": {"type": "string"}, "default": {"type": "string"}, "housing": {"type": "string"}, "loan": {"type": "string"}, "contact": {"type": "string"}, "month": {"type": "string"}, "day_of_week": {"type": "string"}, "duration": {"type": "integer", "format": "int64"}, "campaign": {"type": "integer", "format": "int64"}, "pdays": {"type": "integer", "format": "int64"}, "previous": {"type": "integer", "format": "int64"}, "poutcome": {"type": "string"}, "emp.var.rate": {"type": "number", "format": "double"}, "cons.price.idx": {"type": "number", "format": "double"}, "cons.conf.idx": {"type": "number", "format": "double"}, "euribor3m": {"type": "number", "format": "double"}, "nr.employed": {"type": "number", "format": "double"}}}, "format": "pandas.DataFrame:records"}}}, "GlobalParameters": {"type": "object", "required": ["method"], "properties": {"method": {"type": "string"}}}}, "example": {"Inputs": {"data": [{"age": 0, "job": "example_value", "marital": "example_value", "education": "example_value", "default": "example_value", "housing": "example_value", "loan": "example_value", "contact": "example_value", "month": "example_value", "day_of_week": "example_value", "duration": 0, "campaign": 0, "pdays": 0, "previous": 0, "poutcome": "example_value", "emp.var.rate": 0.0, "cons.price.idx": 0.0, "cons.conf.idx": 0.0, "euribor3m": 0.0, "nr.employed": 0.0}]}, "GlobalParameters": {"method": "predict"}}}, "ServiceOutput": {"type": "object", "required": ["Results"], "properties": {"Results": {"type": "array", "items": {"type": "string"}, "format": "numpy.ndarray"}}, "example": {"Results": ["example_value"]}}, "ErrorResponse": {"type": "object", "properties": {"status_code": {"type": "integer", "format": "int32"}, "message": {"type": "string"}}}}} | ||
{"swagger": "2.0", "info": {"title": "best-mlops-model", "description": "API specification for the Azure Machine Learning service best-mlops-model", "version": "1.0"}, "schemes": ["https"], "consumes": ["application/json"], "produces": ["application/json"], "securityDefinitions": {"Bearer": {"type": "apiKey", "name": "Authorization", "in": "header", "description": "For example: Bearer abc123"}}, "paths": {"/": {"get": {"operationId": "ServiceHealthCheck", "description": "Simple health check endpoint to ensure the service is up at any given point.", "responses": {"200": {"description": "If service is up and running, this response will be returned with the content 'Healthy'", "schema": {"type": "string"}, "examples": {"application/json": "Healthy"}}, "default": {"description": "The service failed to execute due to an error.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/score": {"post": {"operationId": "RunMLService", "description": "Run web service's model and get the prediction output", "security": [{"Bearer": []}], "parameters": [{"name": "serviceInputPayload", "in": "body", "description": "The input payload for executing the real-time machine learning service.", "schema": {"$ref": "#/definitions/ServiceInput"}}], "responses": {"200": {"description": "The service processed the input correctly and provided a result prediction, if applicable.", "schema": {"$ref": "#/definitions/ServiceOutput"}}, "default": {"description": "The service failed to execute due to an error.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}, "/swagger.json": {"get": {"operationId": "GetSwaggerSpec", "description": "Get the Swagger specification.", "parameters": [{"name": "version", "in": "query", "required": false, "type": "integer", "enum": [2, 3]}], "responses": {"200": {"description": "The Swagger specification.", "schema": {"type": "string"}}, "default": {"description": "The service failed to execute due to an error.", "schema": {"$ref": "#/definitions/ErrorResponse"}}}}}}, "definitions": {"ServiceInput": {"type": "object", "properties": {"Inputs": {"type": "object", "required": ["data"], "properties": {"data": {"type": "array", "items": {"type": "object", "required": ["age", "job", "marital", "education", "default", "housing", "loan", "contact", "month", "day_of_week", "duration", "campaign", "pdays", "previous", "poutcome", "emp.var.rate", "cons.price.idx", "cons.conf.idx", "euribor3m", "nr.employed"], "properties": {"age": {"type": "integer", "format": "int64"}, "job": {"type": "string"}, "marital": {"type": "string"}, "education": {"type": "string"}, "default": {"type": "string"}, "housing": {"type": "string"}, "loan": {"type": "string"}, "contact": {"type": "string"}, "month": {"type": "string"}, "day_of_week": {"type": "string"}, "duration": {"type": "integer", "format": "int64"}, "campaign": {"type": "integer", "format": "int64"}, "pdays": {"type": "integer", "format": "int64"}, "previous": {"type": "integer", "format": "int64"}, "poutcome": {"type": "string"}, "emp.var.rate": {"type": "number", "format": "double"}, "cons.price.idx": {"type": "number", "format": "double"}, "cons.conf.idx": {"type": "number", "format": "double"}, "euribor3m": {"type": "number", "format": "double"}, "nr.employed": {"type": "number", "format": "double"}}}, "format": "pandas.DataFrame:records"}}}, "GlobalParameters": {"type": "object", "required": ["method"], "properties": {"method": {"type": "string"}}}}, "example": {"Inputs": {"data": [{"age": 0, "job": "example_value", "marital": "example_value", "education": "example_value", "default": "example_value", "housing": "example_value", "loan": "example_value", "contact": "example_value", "month": "example_value", "day_of_week": "example_value", "duration": 0, "campaign": 0, "pdays": 0, "previous": 0, "poutcome": "example_value", "emp.var.rate": 0.0, "cons.price.idx": 0.0, "cons.conf.idx": 0.0, "euribor3m": 0.0, "nr.employed": 0.0}]}, "GlobalParameters": {"method": "predict"}}}, "ServiceOutput": {"type": "object", "required": ["Results"], "properties": {"Results": {"type": "array", "items": {"type": "string"}, "format": "numpy.ndarray"}}, "example": {"Results": ["example_value"]}}, "ErrorResponse": {"type": "object", "properties": {"status_code": {"type": "integer", "format": "int32"}, "message": {"type": "string"}}}}} |