Deploying and testing models with Azure Machine Learning
The model is now trained, a .pkl file has been created, and the model can be deployed for testing. The deployment part is done in the second notebook, part2-deploy.ipynb, as seen in the following figure. To deploy the model, we open up the part 2-deploy.ipynb notebook by clicking on the notebook in the left pane. We load the .pkl file by calling the joblib.Load method. You also see the run method in the following screenshot, which receives the raw JSON data, invokes the model's predict method, and returns the result:
Figure 4.41 – MNIST image classification notebook
In this step, we create a model object by calling the Model constructor as shown in the following figure. This model uses the configuration properties from the Environment object, and the service name to deploy the endpoint. This endpoint is deployed using Azure Container Instances (ACI). The endpoint location is available once...