ML.NET Model Builder update adds notebooks in Visual Studio – Visual Studio Magazine


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 schema to support interactive data science and scientific computing in all programming languages, Wikipedia says, but are commonly associated with Python. However, native .NET interactive notebooks emerged and proved popular in Visual Studio Code extensions for Python and .NET Interactive.

“They’re great for data exploration and preparation, experimentation, model explainability, and even education,” said Bri Achtman, Program Manager, .NET, in an October 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, resulting in the new Notebook Editor extension!”

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

This brand new extension is currently in the experimental preview stage, only working with the latest stuff, 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 tools extension that leverages automatic machine learning (AutoML) to train and consume ML.NET models customized in .NET applications. It serves as one of two entry points for using the new Notebook Editor tool, as well as the Add New Item dialog.

When generated from Model Builder, a notebook includes:

  • The training pipeline for the model chosen by Model Builder so developers can see how a model was trained and easily retrain it
  • Plots and graphs for data exploration and model explainability techniques so developers 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 generated during model training, containing a Predict() method that developers can use to make predictions with a model in an end-user application, effectively removing Several steps needed to consume an ML.NET mockup:

  • Initializing an MLContext
  • Loading the model
  • Creation of a prediction engine
  • Use the PredictionEngine and the model to make the prediction on the input data

“In the previously generated model consumption code, these steps all happened within the Predict() method, which means they all happened every time the Predict() method was called,” said Achtman. “This caused a performance hit for each prediction, so we updated the code to make it much more efficient, with all of these steps only happening once when using the Predict() method. ”

Achtman also provided an update on the development 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, such as Visual Studio magazine reported in June.

About the Author

David Ramel is an editor and writer for Converge360.

Comments are closed.