In this project we are training an AutoML Model and then it is deployed and then consumed. We are using the Bank Marketing Dataset. We are also creating a pipeline the project.
![Architectural
Uploading the Bank Marketing Dataset in Azure ![Bank Marketing Dataset]
Next, we ran AutoML on the Bank Dataset. It took around 22min to train various models. ![AutoML Run Completion]
Finally, we found the best model. The list is sorted in descending order in terms of accuracy. ![All Models] VotingEnsemble was the best performing model with an accuracy of 91.92%. ![Model with best accuracy]
The next step was to deploy the best model which was VotingEnsemble. ![Deploy Voting Ensemble] ![Deploy Voting Ensemble]
The best performing model was deployed using Azure Container Instance (ACI) and authentication was enabled while deploying. We also enabled Application Insights using logs.py file. Application Insights are disabled before executing logs.py. ![Application Insights] We can also check the logs after running the logs.py file ![Logs] ![Logs]
We'll use the serve.py file to serve json file which contains the schema of the REST API through which the model can be called. We have downloaded the swagger.json file from the deployed model. ![Swagger UI]
Calling the REST API from Swagger ![Swagger POST request]
After the model has been deployed, we'll use the endpoints.py file to send request to the REST API. ![Model Endpoint]
Below is the screenshot that confirms that the AzureML Pipeline was completed the execution successfully. ![Pipeline executed successfully] We can see the details of the pipeline in the endpoints section.![Pipeline Endpoint]
In the below screenshot we can see the pipeline is running ![Pipeline Running]
Run widget gives us information related to the pipeline run status. Through this, you can track the process of the pipelines from the notebook without having to naviagate to the azure studio. ![Pipeline run widget complete]
Finally, we can see the details about the completed pipeline along with other details such as rest endpoints ![Pipeline Endpoint]
- We are using Azure Container Instance (ACI) to deploy the model. We could deploy the model using Azure Kubernetes Instance (AKS) and also compare the deployment time and cost.
- We are choosing the best model based on the accuracy but the data that we are using is imbalanced. The Accuracy metric is not ideal for imbalanced dataset. What We could do is understand the business requirement in more detail and choose the right metric.