{"id":26660,"date":"2020-03-02T09:04:43","date_gmt":"2020-03-02T16:04:43","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=26660"},"modified":"2020-03-02T10:05:56","modified_gmt":"2020-03-02T17:05:56","slug":"ml-net-model-builder-updates","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/ml-net-model-builder-updates\/","title":{"rendered":"February ML.NET Model Builder Updates"},"content":{"rendered":"<p><a href=\"https:\/\/dot.net\/ml\" rel=\"noopener noreferrer\" target=\"_blank\">ML.NET<\/a> is a cross-platform, machine learning framework for .NET developers. Model Builder is the UI tooling in Visual Studio that uses Automated Machine Learning (AutoML) to train and consume custom ML.NET models in your .NET apps. Together, you can now create custom machine learning models for scenarios like sentiment analysis, price prediction, and more. All this without any machine learning experience or even leaving the .NET development environment!<\/p>\n<h2>ML.NET Model Builder<\/h2>\n<p><a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=MLNET.07\" rel=\"noopener noreferrer\" target=\"_blank\">This release<\/a> of Model Builder comes with bug fixes and several exciting new features:<\/p>\n<ul>\n<li><strong>Azure training (image classification)<\/strong> \u2013 harness the power of Azure to scale out training for image classification.<\/li>\n<li><strong>Recommendation scenario<\/strong> \u2013 locally train recommendation models (e.g. to recommend products).<\/li>\n<\/ul>\n<h2>Azure Training (Image Classification)<\/h2>\n<p>We added the <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/model-builder-updates-mlnet\/\" rel=\"noopener noreferrer\" target=\"_blank\">image classification scenario<\/a> to ML.NET Model Builder late last year. Which enabled you to locally train image classification models with your own images. However, you may have noticed the limitations of training on images when using your CPU, particularly the duration of training time.<\/p>\n<p>This month, we are excited to release the ability to train image classification models in Azure Machine Learning directly from Model Builder. Take advantage of the cloud and get even faster, more accurate results!<\/p>\n<p>Let\u2019s look at the dogs vs. cats example. In Model Builder, after selecting the Image Classification scenario and uploading your local dataset, you have the following training options:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step.png\" alt=\"ML.NET Model Builder Image train step\" width=\"2249\" height=\"1442\" class=\"alignnone size-full wp-image-26672\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step.png 2249w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step-1024x657.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step-768x492.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step-1536x985.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/train-step-2048x1313.png 2048w\" sizes=\"(max-width: 2249px) 100vw, 2249px\" \/><\/p>\n<p>To train in Azure, set up an Azure Machine Learning workspace and create an experiment. Do that right in the UI:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog.png\" alt=\"Azure Model Builder Image aml dialog\" width=\"2258\" height=\"1443\" class=\"alignnone size-full wp-image-26666\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog.png 2258w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog-1024x654.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog-768x491.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog-1536x982.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-dialog-2048x1309.png 2048w\" sizes=\"(max-width: 2258px) 100vw, 2258px\" \/><\/p>\n<p>There are several concepts that are specific to Azure and Azure Machine Learning. Learn about workspaces, computes, and experiments in our <a href=\"https:\/\/aka.ms\/mb-azure-docs\" rel=\"noopener noreferrer\" target=\"_blank\">Docs<\/a>.<\/p>\n<p>After setting up your Azure ML workspace and experiment settings, click <em>Start training<\/em> to kick off training in Azure. This will then:<\/p>\n<ol>\n<li>Create a new experiment.<\/li>\n<li>Upload your data to Azure.<\/li>\n<li>Begin training with Azure AutoML.<\/li>\n<\/ol>\n<p>The status will be displayed in the <em>Progress<\/em> section and Output window. On top of that, you will be provided with a link to the Azure ML portal for more information about the training status:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status.png\" alt=\"Image aml train status\" width=\"2258\" height=\"1443\" class=\"alignnone size-full wp-image-26668\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status.png 2258w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status-1024x654.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status-768x491.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status-1536x982.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-train-status-2048x1309.png 2048w\" sizes=\"(max-width: 2258px) 100vw, 2258px\" \/><\/p>\n<p>Once training in Azure is complete, the model is downloaded locally to your machine (both an ML.NET model and an ONNX model). Then, try out your model in the Evaluate step and generate the model consumption code to use the ML.NET model to make predictions. Just like with local image classification training:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval.png\" alt=\"ML.NET Model Builder Image aml eval\" width=\"2258\" height=\"1442\" class=\"alignnone size-full wp-image-26667\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval.png 2258w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval-1024x654.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval-768x490.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval-1536x981.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/aml-eval-2048x1308.png 2048w\" sizes=\"(max-width: 2258px) 100vw, 2258px\" \/><\/p>\n<h2>Recommendation Scenario<\/h2>\n<p>Additionally, we have also added a Recommendation scenario to Model Builder. This locally trains ML.NET models for recommending items (such as products or movies) to users:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario.png\" alt=\"Model Builder Image rec scenario\" width=\"2253\" height=\"1444\" class=\"alignnone size-full wp-image-26671\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario.png 2253w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario-1024x656.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario-768x492.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario-1536x984.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-scenario-2048x1313.png 2048w\" sizes=\"(max-width: 2253px) 100vw, 2253px\" \/><\/p>\n<p>With this recommendation model, you can predict what rating a user will give to specific items based on historical item rating data. Then get the top rated \/ recommended items for a particular user. This type of recommendation in Model Builder uses the matrix factorization algorithm. <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/machine-learning\/resources\/tasks#recommendation\" rel=\"noopener noreferrer\" target=\"_blank\">Learn more in our documentation<\/a>.<\/p>\n<p>Matrix factorization has several different algorithm <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/microsoft.ml.trainers.matrixfactorizationtrainer.options?view=ml-dotnet-preview\" rel=\"noopener noreferrer\" target=\"_blank\">options<\/a> which can be tuned to better suit your data needs. Model Builder tries out different combinations of these options in the given amount of training time. After that, chooses the combination of options which gives the best performance (measured by <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/machine-learning\/resources\/metrics#evaluation-metrics-for-regression-and-recommendation\" rel=\"noopener noreferrer\" target=\"_blank\">RMSE<\/a>).<\/p>\n<p>To use the Recommendation scenario in Model Builder, your dataset must have three specific columns:<\/p>\n<ol>\n<li>User column<\/li>\n<li>Item column<\/li>\n<li>Rating column<\/li>\n<\/ol>\n<p>Let\u2019s use movie recommendation as an example. With a dataset (taken from the <a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/Movie\" rel=\"noopener noreferrer\" target=\"_blank\">MovieLens<\/a> dataset) which has columns for <em>userId<\/em>, <em>movie<\/em>, <em>timestamp<\/em>, and <em>ratings<\/em>. In the Data screen in Model Builder, the Column to predict is the <em>ratings<\/em> column. The User column is the <em>userId<\/em> column. And the Item column is the <em>movie<\/em> column (the <em>timestamp<\/em> column is ignored):<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data.png\" alt=\"Model Builder Image rec data\" width=\"2258\" height=\"1444\" class=\"alignnone size-full wp-image-26669\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data.png 2258w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data-1024x655.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data-768x491.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data-1536x982.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-data-2048x1310.png 2048w\" sizes=\"(max-width: 2258px) 100vw, 2258px\" \/><\/p>\n<p>After the model is finished training, try out the recommendation model in the Evaluate screen in Model Builder. Specifically, input a userId and a movie to get the predicted rating that the user will give that particular movie. As well as the top 5 recommended movies for the specified user:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval.png\" alt=\"Image rec eval\" width=\"2258\" height=\"1445\" class=\"alignnone size-full wp-image-26670\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval.png 2258w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval-300x192.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval-1024x655.png 1024w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval-768x491.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval-1536x983.png 1536w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2020\/02\/rec-eval-2048x1311.png 2048w\" sizes=\"(max-width: 2258px) 100vw, 2258px\" \/><\/p>\n<h2>Share Your Feedback<\/h2>\n<p>Since Model Builder is still in Preview, your feedback is super important in driving the direction of this tool and ML.NET in general. We would love to <a href=\"https:\/\/www.research.net\/r\/blog2\" rel=\"noopener noreferrer\" target=\"_blank\">hear your feedback<\/a>!<\/p>\n<p>If you run into any issues, please let us know by creating an issue in our <a href=\"http:\/\/www.github.com\/dotnet\/machinelearning-modelbuilder\" rel=\"noopener noreferrer\" target=\"_blank\">GitHub repo<\/a>.<\/p>\n<h2>Get Started with ML.NET Model Builder<\/h2>\n<p>Download ML.NET Model Builder in the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=MLNET.07\" rel=\"noopener noreferrer\" target=\"_blank\">VS Marketplace<\/a>. Additionally, find it in the Extensions menu of Visual Studio.<\/p>\n<p>Learn more in the <a href=\"http:\/\/aka.ms\/modelbuilder-docs\" rel=\"noopener noreferrer\" target=\"_blank\">ML.NET Docs<\/a>. Get started with this <a href=\"https:\/\/dotnet.microsoft.com\/learn\/ml-dotnet\/get-started-tutorial\/intro\" rel=\"noopener noreferrer\" target=\"_blank\">intro tutorial<\/a>.<\/p>\n<p>Not currently using Visual Studio? Try out the <a href=\"http:\/\/aka.ms\/mlnet-cli\" rel=\"noopener noreferrer\" target=\"_blank\">ML.NET CLI<\/a>. (Image classification and recommendation will be implemented in the next CLI release.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the ML.NET Model Builder, create custom machine learning models for scenarios like sentiment analysis, price prediction, and more without any machine learning experience and without leaving the .NET ecosystem!<\/p>\n","protected":false},"author":721,"featured_media":24299,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,328,688,691],"tags":[4,568,37,93,96,6098],"class_list":["post-26660","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-aiml","category-machine-learning","category-ml-dotnet","tag-net","tag-ai","tag-azure","tag-machine-learning","tag-ml-net","tag-model-builder"],"acf":[],"blog_post_summary":"<p>With the ML.NET Model Builder, create custom machine learning models for scenarios like sentiment analysis, price prediction, and more without any machine learning experience and without leaving the .NET ecosystem!<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/26660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/721"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=26660"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/26660\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/24299"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=26660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=26660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=26660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}