Introduction to Machine Learning and ML.NET

Now a days Machine Learnings are getting more popular and is been using in wide industry as well us in our day to day life. In this Article we will be learning on how to develop Machine learning Applications using Microsoft ML.NET (Machine Learning .NET), If we have a basic knowledge on Machine learning, Machine Learning Types and Algorithm, it will be easier for us to select appropriate Machine learning task and Model to develop our Machine learning application. For this in this chapter we will start with

  1. Introductions to Machine Learning
  2. Introduction to Machine Learning Types and Algorithm
  3. Why Machine Learning getting more popular
  4. Introduction to Microsoft ML.NET
  5. Features of ML.NET

 Introductions to Machine Learning

Machine Learning is an application, which is a part of Artificial Intelligence (AI), Machine Learning uses algorithm and statistical Technics to train the systems by themselves without using any explicit programs. Machine Learning is used to train the systems automatically by themselves and provide us the system predicted results. In Machine Learning for the training and predicting results we need to provide lots of data. In Machine Learning 2 magical words are mostly used they are  

  • Training
  • Data

To understand about training and data let’s see our real like example, when a new baby born parents, teachers and neighbor’s will start teaching the kids by showing the object, we can say a parent are teaching the infant a first time by showing an Apple and they will repeatedly tell to the infant as this is apple and apple will be in red color, the shape of the apple will be like this, here the apple is the data for the kid and kids brain is trained as the Apple will be red in color and Apple will be looks like this and Apple will be available in different kind of shapes and color, Once the infant brain is trained with the object whenever an infant see the apple object immediately they will tell as Apple.

Same like training the infant for the first time by showing the object, we do train the machine with lot of data to predict and return the result for us. For training the machine we need lots of providing lot of related data to the machine the machines will be well trained and good to predict the accurate results for us. We can see the below image as an example for the data, here for example let’s consider we train the machines to predict the number and display the result. Here we have used the data as image and we can see different kind of no 2 has been created with different font and also used by hand drawing. All this number 2 will be given to the machines by data and trained the machines to predict the result.

Again, you all will be wondering about training and how can we train the machines, for this in Machine learning we have Machine learning Task and Algorithms, as we already know as for Machine learning we no need to write any program explicitly, as we will be using the machine learning algorithm to predict the results. Now we will see about few Machine Learning type and Algorithms. 
Machine Learning Process

In the below image we can see the Machine learning process has been explained as first we give the data to the system and then we select the appropriate Machine Learning Model to train the system, After the train is completed the machine is ready to predict the results and show the output to the outside world.

Introduction to Machine Learning Types and Algorithm

In Machine learning, Types and Algorithm are very important, if we want to develop a Machine learning application then we should understand what are Machine learning Types and which type and algorithm should be selected for our applications to train and predict the results. This articleis focused to use the Machine learning for the Supervised Learning Type and Unsupervised Learning, we will be seeing in detail about 2 major type of Machine Learning as

  • Supervised Learning
  • Unsupervised Learning  

We will be seeing Supervised and Unsupervised Machine learning types and Algorithm with example.  

From the above diagram we can see few of the Machine learning Types and algorithm with examples as in which kind of application each Machine learning types and algorithm can be used. In this article we will using Supervised Learning with Regression and Classification model and Unsupervised type with Clustering model. Now let’s see in detail of each Machine learning type and algorithm.

Supervised Learning

In the Supervised learning the computer will get the labeled input and the desired output. First, we will see an example for using the Regression model for the Housing price prediction per city, for this we will be giving all the house details for the particular City with City Name, Area Name, House Type, Floor details, No of Rooms and House Rent.

In the above image we can understand the housing information for three different type of house as Single house, Villa type and Apartment type with no of room information, this are all not exact price of the house in the particular city, it’s all sample housing type and prices for easy understand of the concepts. As from the above image we can easily understand the current housing price for the particular area in that city. All this information of City Name, Area Name, House Type, Floor details, No of Rooms and House Rent information for all the houses in that city will be given as the input to the machine to predict the housing rent for user search. When we search for the house  we will be giving the input as the City Name, Area Name ,No of Rooms we need, Which type of house we preferred and what budget we are looking for the house, Here the budget is the key keyword for our search and the output we will be looking in our search will be as the house rent of the searched result , here for the Machine learning Supervised Type and regression model we will be giving the house rent as the labeled input .We train the machine with all the inputs and labeled input. After training Machine will predict the result using the regression algorithm and produce the predicted result for us as the house rent.

If a user search for a house rent with 3 rooms, Apartment type house in Madurai city and in Annanagar area, with all the data given to the machine the machine will predict the result and machine will display the approximate output as 15000.In Machine Learning we need to give lot of data to

In Supervised learning one more model will be used as the Classification model, Classification model will be used for Mail spam detection and for sentiment predictions.

Unsupervised Learning

In the Unsupervised Learning computer will get the input without the desired output. The main aim of this model is to find the structure in the inputs.

In Unsupervised learning we have the Clustering model, Clustering model can be used to find the Cluster of the Customer segmentation of our products, we can say an example as Customer Segmentation for our product sales. Let’s consider we have “ABC”, XYZ” and “123” as three different products and the products we do sales in the four major city in Delhi, Mumbai, Kolkata and in Chennai. We group all the sales history of our three products for the four city and want to find the cluster of our product in this case we can use the Unsupervised Learning using clustering model.

Why Machine Learning getting more popular?

Now a days Machine learning are widely using in our day today life, in lots of industries, in research fields, In Science and etc. Machine Learning also used to automate the systems example like we can say the Mail spam detection and fraud detection.  Machine Learning in our day today life, we can say the Facebook news feed as an example, we can see in our Facebook wall as we will be seeing all the news feed related to our frequently or recently visiting friends post. Facebook using machine learning concept for the news feed. Machine learning also using in wide industries today like Manufacturing, Healthcare, Financial services, Travel, Retail and etc. Machine learning also using to make driverless cars (i.e. self-driving cars). In self-driving cars used Sensors to identify the objects coming closer in all the four sides depend on the objects the car speed will be controlled and also using the navigation the self-driving cars will be reach the destination, In the navigation all the information will be stored as traffic place and present traffic signal. For the Self-driving car Machine learning concepts Reinforcement learning type will be used. Machine learning also now widely using in research and medical field example like to predict the viral failure in AIDS, Parkinson disease progression prediction, Smart Farming, Bio Technology for Drug development, medical therapy, used in cosmological maps and etc.

In the future the Machine learning will be used widely in all the fields and it will be getting more popular then today.

We have seen how and why the Machine learning are getting more popular nowadays and Microsoft also has introduced a new Framework called as ML.NET in the march month during Build 2018.ML.NET stands for the Machine Learning.Net which is used to develop the Machine Learning applications using .Net, we will be seeing more detail about ML.NET in our upcoming chapters.

Introduction to Microsoft ML.NET

Microsoft interduce ML.NET (Machine Learning.NET) during Build 2018(March). The current version of ML.NET is ML.NET preview 1.4 which was released September 2019,Machine Learning.Net is a framework which is a cross-platform and open source.  Yes, now it’s easy to develop our own Machine Learning application or develop custom modules using Machine Learning framework. For all the .NET lovers its great news as we can use C# or F# code to develop Machine Learning using the ML.NET.ML.NET is open source and can be develop and run on Windows, Linux and macOS. We can develop custom machine learning models using ML.NET for Console, desktop, web, mobile, gaming and for the IOT.M L.NET also supports to extend and work with TensorFlow, Accord.NET and CNTK.The latest relase of ML.NET also support to load and train data from Relational database like SQL Server, Oracle, MySQL and etc..The latest version of ML.NET also established to develop easy custom ML using AutoML.

Presently Microsoft has released the preview version of the ML.NET and Microsoft keep on adding more features to the ML.NET framework, present version of ML.NET is ML.NET 0.7, In this article we will be using the current version of ML.NET 0.7 for the development and readers kindly check for the updates in Microsoft website for the latest version.

Before getting started with the ML.NET, lets understand the basic concept of the ML.NET which need to be used to develop our Machine learning applications.

Load Data: For the perfect prediction of results we need to give lot of data to train the model. In ML.Net we can give the data for both train and test by Text (CSV/TSV, Relational Database (Now support SQL Server, Oracle, MySQL and etc.)), Binary, IEnumerable and etc.

Train: We need to select the right algorithm to train the model. depend on our need we need to pick the correct algorithm to train and predict the results.

Evaluate: Select the Machine learning type for our model training and prediction. If you need work with segment then you can select the Clustering model, if you need to find the price of stock prediction you can select the Regression and if you need to find the sentiment analysis then can select the Classification model.

Predicted Results: Based on the train and test data with trained model the final prediction will be displayed using the ML.NET application. Trained model will be saved as the binary format which can also be integrate with our other .NET applications.

The above picture explains the flow of process which we will be used to develop of our machine learning applications using the ML.NET. Next, we will see more in detail about ML.NET components  

Features of ML.NET

Now let’s see some of the uses and features of the Microsoft ML.NET.

  • All the DotNet lovers can write their code for Machine Learning using ML.NET
  • You can use C# or F# to code with ML.NET
  • ML.NET is cross-platform and open source framework.
  • ML.NET can be develop and run on Windows, Linux and macOS
  • Extensively used across Microsoft Windows, Bing, Azure and also Extensible to other frameworks like TensorFlow, CNTK and Accord.NET.
  • ML.NET supports to develop Machine Learning apps for web, mobile, desktop, gaming and IOT.
  • ML.NET saves the trained model as a binary file and it can be integrated into any other DotNet applications.
  • ML.NET is now in preview version and Microsoft frequently adding many new features and also planned to add the Deep Learning with TensorFlow and CNTK
  • ML.NET preview version 0.2 introduced the new Machine learning Clustering Tasks.
  • ML.NET preview version 0.5 Added a TensorFlow model scoring transform
  • ML.NET preview version 0.6 added ability to score pre-trained ONNX models.
  • Now from the ML.NET 0.7 version it supports both x86 and x64.ML.NET is in preview version now and Microsoft is frequently updating the version by adding more features to ML.NET. The Previous versions of ML.NET 0.7 only support to develop for   x64 but from the new ML.NET 0.7 version supports to develop for both x86 and x64.
  • ML.NET preview version 0.7 supports in experimental Python bindings for ML.NET called NimbusML.
  • ML.NET preview version 0.7 enabled anomaly detection scenarios.
  • ML.NET preview version 0.9 was added with few of ML.NET API improvements.
  • ML.NET 1.0 has been added with Automated machine learning (AutoML) and introduced some more new tools like ML.NET CLI and ML.NET Model Builder
  • ML.NET 1.1 has been released with improved support for In-Memory Image type in IDataView also added a new algorithm Anomaly Detection algorithm.     
  • ML.NET 1.2 has released with support to integrate ML.NET models in web or serverless apps with Microsoft.Extensions.ML integration package
  • ML.NET preview version 1.4 Database loader which made easy to train using the relational database.


ML.NET preview 1.4 is the current released vision of today (Sep 2019). Microsoft is keep on updating ML.Net by adding more features so always keep on check for the latest update and wait till the complete ML.NET version is published. In our next part we will learn on woking with ML.NET for each models and Algorithm with latest release version and features. Hope you all understand what is Machine Learning and ML.NET from this part 1 and in our next part will be deeply looking into Getting started with ML.NET.

See Also