After training is completed, three files are automatically added as code-behind to the
SentimentModel.zip: This file is the trained ML.NET model, which is a serialized zip file.
SentimentModel.consumption.cs: This file contains the model input and output classes and a
Predictmethod that can be used for model consumption.
SentimentModel.training.cs: This file contains the training pipeline (data transforms, algorithm, and algorithm parameters) used to train the final model.
In the Consume step in Model Builder, a code snippet is provided which creates sample input for the model and uses the model to make a prediction on that input.
Model Builder also offers Project templates that you can optionally add to your solution. There are two project templates (a console app and a web API), both which consume the trained model.
The ML.NET CLI adds both the machine learning model and the projects for training and consuming the model to your solution, including:
SampleClassification.ConsoleApp) that includes the following files:
ModelBuilder.cs: used to build/train the model
Program.cs: used to run the model
SampleClassification.Model) that includes the following files:
ModelOutput.cs: input and output classes for model training and consumption
MLModel.zip: generated serialized ML model
To try the model, you can run the console app (
SampleClassification.ConsoleApp) to predict the sentiment of a single statement with the model.