Deploying a model in an ASP.NET Core web API
In this section, we will learn how to integrate our ML.NET model into an existing web API. To do so, we will jump to the Consume panel of Model Builder.
Figure 7.9 – Consume
The Consume panel within Model Builder is a critical tool for integrating our trained ML models into .NET applications. Once we’ve completed the evaluation phase, Model Builder generates a model file and the necessary code to incorporate the model into our application. These models are saved as a .zip
file, and the code to load and use our model is added as a new project within our solution. Additionally, Model Builder provides a sample console application that we can run to see our model in action.
The Consume panel gives us options to create projects that consume our model, such as the following:
- Console app: Generates a .NET console application specifically for making predictions using our model
- Web API: Sets...