We use Azure to configure a cloud-based machine learning production model, deploy it to a REST EP(URI + authentication key) for real-time inferencing, and consume it. We also create, publish to REST EP, and consume a pipeline.
We first register a dataset and create an automl run. Once the run is complete, we can deploy the best model. After deployment, the model is registered and Endpoint is available for us to use. We then enable application insights for this EP with help of logs.py script. After that we make use of swagger URI provided in the EP and run both swagger.sh and serve.py so we can see the swagger documentation (It gives us a place to check what paths are available and the expected requests and responses). We run endpoint.py which send request to REST URI and valid JSON response can be seen in the output. Additionally, we use apache benchmark to get the stats of the EP.
Log outputs - fulloutput
Consume EndPoint endpoint.py output benchmark.sh output - fulloutput
We create and publish a pipeline containing an automl module and the dataset. The pipeline is invoked using the pipeline REST EP(The last run will have finished status in Screencast)
Configure a pipeline with the Python SDK
Use a REST endpoint to interact with a Pipeline
As of now, we only have automl run in the pipeline. We can add the deploy best model(if the primary metric is in required range) to the pipeline and also add a simple health check for the REST EP.
Using Service principal for authentication as it is a better way to write secure scripts or programs, allowing you to apply both permissions restrictions and locally stored static credential information.
The model performance can be improved by giving a balanced dataset as input(by undersampling or oversampling methods) and by exploring the automl config(like adding custom FeaturizationConfig)