News

ML.NET Model Builder Update Adds Notebooks in Visual Studio

Interactive notebooks, so vital to AI, data science and machine learning development projects, are coming to Microsoft's flagship Visual Studio IDE via an experimental extension.

Notebooks were popularized in the Jupyter scheme to support interactive data science and scientific computing across all programming languages, Wikipedia says, but are typically associated with Python. Native .NET Interactive Notebooks have emerged, however, and have proved popular in Visual Studio Code extensions for Python and .NET Interactive.

"They are great for data exploration and preparation, experimentation, model explainability, and even education," said Bri Achtman, program manager, .NET, in an Oct. blog post announcing updates to ML.NET, Microsoft's machine learning framework for .NET. "After talking to customers, the team decided to experiment with Interactive Notebooks in Visual Studio which has resulted in the new Notebook Editor extension!"

Visual Studio 2022 Notebook Editor
[Click on image for larger view.] Visual Studio 2022 Notebook Editor (source: Microsoft).

That brand-new extension is currently in the experimental preview stage, only working with the latest bits, Visual Studio 2022 Preview 4, which shipped last month.

Achtman discussed the notebook extension in the context of ML.NET's Model Builder, a UI tooling extension that leverages Automated Machine Learning (AutoML) to train and consume custom ML.NET models in .NET apps. It serves as one of two points of entry to use the new Notebook Editor tool, along with using the Add New Item dialog.

When generated from Model Builder, a notebook includes:

  • The training pipeline for the model chosen by Model Builder so that developers can see how a model was trained, and easily re-train it
  • Plots and graphs for data exploration and model explainability techniques so that devs can more easily understand and explain their data and model

When generated from the menu, a new notebook is empty.

Another Model Builder update affects the Consumption file that gets generated during model training, containing a Predict() method which developers can use to make predictions with a model in an end-user application, effectively abstracting away several steps needed to consume an ML.NET model:

  • Initializing an MLContext
  • Loading the model
  • Creating a PredictionEngine
  • Using the PredictionEngine and the model to make the prediction on the input data

"In the previously generated model consumption code, these steps all happened inside the Predict() method, meaning that these all happened every time the Predict() method was called," Achtman said. "This resulted in decreased performance on each prediction. So, we updated the code to make it a lot more efficient where all of these steps only happen once when using the Predict() method."

Achtman also provided an update on the dev team's efforts to address ML.NET "pain points" that were identified in a survey where users were asked about the biggest blockers/pain points/challenges reported by respondents when using ML.NET, as Visual Studio Magazine reported in June.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube