Hosting ML.NET models in ASP.NET web applications
ML.NET models can be embedded into a wide range of applications, including Azure functions, console, desktop, and mobile applications. However, the most commonplace ML.NET models are deployed is to ASP.NET applications.
ASP.NET is a web application framework that allows developers to build web applications and web APIs. At the time of writing this chapter, builtwith.com estimated that there were over five million active websites running ASP.NET worldwide.
While covering the way ASP.NET works is beyond the scope of this book, there are a large number of resources available that cover ASP.NET in more detail, including a number of books from Packt.
You can embed an ML.NET model into an ASP.NET application by following these steps:
- Copy the model’s
.zip
file into either the ASP.NET application’s root directory or to an online location that can be referenced via a URL. - Add classes to your project representing...