Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions docs/machine-learning/automate-training-with-model-builder.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: What is Model Builder and how does it work?
description: How to use the ML.NET Model Builder to automatically train a machine learning model
ms.date: 06/01/2020
ms.date: 07/11/2020
ms.custom: overview, mlnet-tooling
#Customer intent: As a developer, I want to use Model Builder to automatically train a model using a visual interface.
---
Expand All @@ -13,11 +13,25 @@ Model Builder uses automated machine learning (AutoML) to explore different mach

You don't need machine learning expertise to use Model Builder. All you need is some data, and a problem to solve. Model Builder generates the code to add the model to your .NET application.

![Model Builder Visual Studio extension user interface animation](media/ml-dotnet-model-builder.gif)
![Model Builder Scenarios](./media/model-builder-scenarios.png#lightbox)

> [!NOTE]
> Model Builder is currently in Preview.

## Creating a Model Builder Project

When you first start up Model Builder it will ask for you to name the project. This will create an `mbconfig` configuration file inside of the project.

The `mbconfig` file keeps track of everything you do in Model Builder to allow you to reopen the session.

After training, three files are generated under the *.mbconfig file:

- **Model.consumption.cs:** This file contains the `ModelInput` and `ModelOutput` schemas as well as the `Predict` function generated for consuming the model.
- **Model.training.cs:** This file contains the training pipeline (data transforms, algorithm, algorithm hyperparameters) chosen by Model Builder to train the model. You can use this pipeline for re-training your model.
- **Model.zip:** This is a serialized zip file which represents your trained ML.NET model.

When you create your `mbconfig` file, you're prompted for a name. This name is applied to the consumption, training, and model files. In this case, the name used is _Model_.

## Scenario

You can bring many different scenarios to Model Builder, to generate a machine learning model for your application.
Expand Down Expand Up @@ -98,7 +112,7 @@ Once you have chosen your scenario, Model Builder asks you to provide a dataset.

![Diagram showing Model Builder steps](media/model-builder-steps.png)

Model Builder supports datasets in .tsv, .csv, .txt formats, as well as SQL database format. If you have a .txt file, columns should be separated with `,`, `;` or `/t` and the file must have a header row.
Model Builder supports datasets in .tsv, .csv, .txt formats, as well as SQL database format. If you have a .txt file, columns should be separated with `,`, `;` or `\t`.

If the dataset is made up of images, the supported file types are `.jpg` and `.png`.

Expand Down Expand Up @@ -217,11 +231,14 @@ If your model performance score is not as good as you want it to be, you can:

- Balance your data. For classification tasks, make sure that the training set is balanced across the categories. For example, if you have four classes for 100 training examples, and the two first classes (tag1 and tag2) are used for 90 records, but the other two (tag3 and tag4) are only used on the remaining 10 records, the lack of balanced data may cause your model to struggle to correctly predict tag3 or tag4.

## Code
## Consume

After the evaluation phase, Model Builder outputs a model file, and code that you can use to add the model to your application. ML.NET models are saved as a zip file. The code to load and use your model is added as a new project in your solution. Model Builder also adds a sample console app that you can run to see your model in action.

In addition, Model Builder outputs the code that generated the model, so that you can understand the steps used to generate the model. You can also use the model training code to retrain your model with new data.
In addition, Model Builder gives you the option to create projects that consume your model. Currently, Model Builder will create the following projects:

- **Console app:** Creates a .NET Core console applications to make predictions from your model.
- **Web API:** Creates an ASP.NET Core Web API that lets you consume your model over the internet.

## What's next?

Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.