Microsoft Ignite 2019
Miss the Application Development Keynote? Don’t fret, catch it, and more great content on demand.

ML.NET Tutorial - Get started in 10 minutes

Generate code

In the Code step in Model Builder, select Add Projects.

Model Builder adds both the machine learning model and the projects for training and consuming the model to your solution. In the Solution Explorer, you should see the code files that were generated by Model Builder.

mlMLAppML.ConsoleApp and myMLAppML.Model projects are added to the myMLApp solution


myMLAppML.ConsoleApp is a .NET console app which contains ModelBuilder.cs (used to build/train the model) and Program.cs (used to test run the model).

myMLAppML.Model is a .NET Standard class library which contains ModelInput.cs and ModelOutput.cs (input/output classes for model training and consumption), ConsumeModel.cs (class that contains method for model consumption), and MLModel.zip (trained serialized ML model).

The ML.NET CLI adds both the machine learning model and the projects for training and consuming the model to your solution, including:

  • A .NET console app (SampleBinaryClassification.ConsoleApp), which contains ModelBuilder.cs (used to build/train the model) and Program.cs (used to run the model).
  • A .NET Standard class library (SampleBinaryClassification.Model), which contains ModelInput.cs and ModelOutput.cs (input/output classes for model training and consumption) and MLModel.zip (generated serialized ML model).

To try the model, you can run the console app (SampleBinaryClassification.ConsoleApp) to predict the sentiment of a single statement with the model.

Continue