ML.NET– Machine Learning Framework for .NET Developers
Table of contents
Machine Learning and Artificial Learning are not the new kids on the block anymore. Quite surprisingly, they have become the most liked dudes in the town, and it seems that they are here to take over the entire globe. Talking about machine learning, we cannot miss a great addition to the development world in the form of ML.NET, which is a machine learning enabled framework built for the .NET developers. Created by Microsoft, ML.NET is a free, open-source, and cross-platform framework with in-built machine learning capabilities accessible on the .NET platform used by developers.
We are going to know about a technology that is built with inherent capabilities to easily create, train, build, and ship machine learning modules using C# and F#. Such a setting works for a wide range of machine learning events. With inbuilt features and functions that include automated machine learning, TensorFlow, etc., making integration of machine learning capabilities in a software or application easier and streamlined.
What Is A Machine Learning Framework?
Wondering what is a machine learning framework is? In simple terms, machine learning frameworks are specialized environments integrated with features and functions that help build machine learning models with speed and higher accuracy. With inbuilt machine learning algorithms, such a framework gives more power to a machine learning engineer helping build and deploy the required models. Microsoft ML.NET is one of many frameworks that allows a machine learning engineer, data scientist, and developer complete the ML lifecycle.
Working with a machine learning framework, developers and business owners can expedite their efforts to integrate ML capabilities into their work. They can create the right and adaptable machine learning aspects into their digital solutions and leverage the benefits that come along with including machine learning into everyday business. Furthermore, companies using a machine learning framework like ML.NET and others can enhance the speed of their project. This means that in a competitive industry, they can substantially reduce their time to market and still provide their users with an advanced application. Moving forward with our discussion on what is Microsoft ML.NET, we will talk about the different characteristics of the framework, its features, and its advantages.
ML.NET makes it easier to ship the machine learning models into small to large-scale enterprise applications helping them transition into a well-built and modern platform with creative possibilities. In terms of performance, a group of scientists conducted research on the performance-led abilities of a framework like ML.NET to ship machine learning models into the application development process. In this experiment, the scientists exposed the machine learning framework by Microsoft to large data sets included with numeric matrix using a hash function.
The figure above is taken from the same study, and it shows the performance of ML.NET to complete the dataset analysis in the shortest possible time. In this comparison, the study also did the same test with other similar frameworks. This performance study shows that ML.NET addresses the core elements of modern-day application development exercise and includes the concepts relevant and pertinent to the future today.
The Microsoft AI ML.NET framework brings the ability to work with machine learning into Visual Studio. A small ML.NET tutorial will help you learn how to integrate the modules and API models of machine learning and render them via Visual Studio. Microsoft provides a convenient and faster visual interface with the model builder to build, train, and deploy tailor-made machine learning models into the application. In other words, working with ML.NET model builder does not require anyone to gain expertise in machine learning.
Furthermore, the model builder also has an automatic setting to explore and find the right machine learning settings for your application. With the help of AutoML, the ML.NET machine learning framework model builder will automatically help you integrate the perfect settings and modules required for your product.
The concept of decision-making in Machine Learning and Artificial Intelligence has long been a contentious issue debated globally. With machine learning models acting as opaque boxes where we know what’s going on and what comes out, it is quite intriguing to implement these models in our daily lives without knowing the intermediate steps. A simple example of this is a machine or a robot making healthcare decisions based on the data fed to the same. But the human doctors will need to understand how the robot reached the conclusion and what factors were taken into consideration for the same. Model explainability in this machine learning framework is addressed with Permutation Feature Importance (PFI). With PFI, ML.NET delivers an ImmutableArray of RegressionMetricsStatistics.
The PFI technique is purposeful in explaining the classification and regression models taken from Breiman’s Random Forests paper. With the help of these regression models, ML.NET shuffles the entire dataset and calculates the intensity of change in the performance metric. A larger change in the performance metric means that a particular feature is more important and vice versa. Taking out health diagnosis again, a machine learning framework will take into account all the factors that could lead to the present condition. By effectuating an increase and decrease in the factors, the ML.NET-powered solution will then discover the factors that had the highest role to bring about that change.
Infer.NET is different from ML.NET requirements, use cases, and features. Although it is also a machine learning framework, Infer.NET supports the Bayesian Inference graphical models. We can use Infer.NET for probabilistic programming by a machine learning engineer to conduct automated inference for the probabilistic models. ML.NET machine learning framework is different than Infer.NET. But it is extensible enough to leverage the capabilities of Infer.NET, giving ML.NET access to better and extensive access to different types of modules like image classification, object detection, etc. Along with Infer.NET, ML.NET’s extensibility also includes ONNX Model Integration and TensorFlow Model Integration. With ONNX, the developers can run any sort of pre-trained ONNX model required to build the perfect solution into Microsoft AI ML.NET. With TensorFlow integration, the developers can access a widely reputed deep learning library and get access to functions like image classification.
NimbusML Python Support
NimbusML is a Python module integrated with ML.NET machine learning framework to forward the Python bindings for Microsoft’s ML.NET. The purpose of building NimbusML is to help the data scientists accustomed to working with Python leverage the possibilities and functional aspects offered by ML.NET. Microsoft understood that if data scientists are left to dabble between Python and .NET, it will increase their work. So, they made ML.NET extensible enough to include the modules built on Python by the developers, machine learning engineers, and data scientists to include into ML.NET.
ML.NET Version History
Now that we have understood what is ML.NET and how it works in coherence with other platforms let’s briefly go though the history of the framework to relate with its journey till the last stable release. ML.NET was launched on 7th May 2018 at Build 2018 with a limited number of Extensions (Accord.NET and CNTK), making them usable through the ML.NET API. During the launch, the ML.NET requirements were not too extensive as the users only had to install the framework NuGet from the CLI using;
dotnet add package Microsoft.ML
Initially, Microsoft used ML.NET only for its in-house operations and products, including Bing Ads, Office, Windows, Azure, etc. When it was working for in-house operations, Microsoft AI ML.NET received monthly updates until its public release with ML.NET 1.0 as the base version in May 2019. After the base version, we have seen regular updates being given to the framework creating new possibilities in the realm of machine learning and its usage in digital solution development.
Here are a few major features added to this machine learning framework against their release version.
|Release Version||Feature Added|
|ML.NET v1.1.0||Support for in-memory images|
Anomaly Detector with Super-Resolution
|ML.NET v1.2.0||Tree-based Featurization|
Support for Microsoft Extensions
|ML.NET v1.3.1||Introduced Deep Neural Network Training|
|ML.NET v1.4.0||Image Classification API Integration with Microsoft.ML.Vision|
|ML.NET v1.5.0||Export to ONNX and its associated bug fixes|
New Anomaly detection system
|ML.NET v1.5.2||New API modules and algorithms for Time Series Data|
ML.NET C# and F# are undergoing continuous developments and adding new features to enhance the functionality and circle of possibilities.
When you are learning how to use ML.NET on the .NET framework, it is important to identify the core features of the platform. It will help you build futuristic products redefining what an application can do and deliver. So, here are a few features of the framework that you should know.
- Open Source and Free
Starting off with the most amazing aspect, Microsoft AI ML.NET is a free and open-source cross-platform framework. This means that you can run this framework in any environment and every device. Be it on Azure, On-Premises, or any sort of Cloud; you can access ML.NET tutorials, Model Builder and use its extensions to enhance the development environment. In addition to this, you can also build the required digital solution on Windows, Linux, and macOS.
By far one of the most remarkable abilities of ML.NET is AutoML. The purpose of adding this is to create custom ML models in the interface to automate building top-performing variants. This means that in every machine learning scenario, or where you need to access the possibilities of ML, AutoML will suggest the best performing model for the required scenario. Your job is limited to feeding the data to the AutoML, and it will automatically model the building process. For a machine learning engineer, this feature is no less than magic because he will access the best possible combination of solutions without having to do any leg work.
- ML.NET CLI
We have earlier talked about the Model Builder, wherein the developers and engineers can create the required models automatically. However, for machine learning engineers that do not use Visual Studio or do not have access to a Windows-based platform they can leverage the AutoML functionalities with ML.NET CLI. For this, you need to install the ML.NET CLI tool and run it on Command Prompt. This will help generate high-quality machine learning models depending on the datasets you provide. Similar to Model Builder, the CLI will also generate the sample ML.NET C# code that can then be used to create and train the required function.
ML.NET is built by Microsoft as a machine learning framework to help developers, data scientists, and machine learning engineers use AI/ML to create advanced solutions by working on dot net with C# and F#.