Introduction To Machine Learning And ML.NET

Introduction to Machine Learning and ML.Net

Artificial Intelligence has been a very popular area among computer scientists, researchers, and developers for many years. It is the capability to act intelligently and autonomously by machines in generic to more specific scenarios. We have come a long way in this field but there is still a long way to go to achieve a point where machines can think or act intelligently in a similar  way to the human mind.
For a few years now, we have been listening to the buzz word “Machine Learning”. In this article, I am trying to give a high-level overview of machine learning, its applications and will introduce a platform called ML.Net provided by Microsoft to implement machine learning in .Net applications.

So what exactly is Machine Learning?

It is a branch of Artificial intelligence, where machines learn from a large amount of data and become able to predict the output for new data. The name machine learning was introduced by Arthur Samuel in 1959. According to him
“It is a field of study that gives the ability to the computer for self-learn without being explicitly programmed”
More recently in 1997, Tom M. Mitchell provided a more formal definition of the algorithms studied in the machine learning field as,
“A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P if its performance at tasks in T, as measured by P, improves with experience E. ”
Okay, so, in more general words, Machine Learning is a category of algorithms that can receive the training data as input, build the model by learning and understanding this data and use this model to predict the output of new data sometimes called test data.
The ML field is very vast and is expanding very rapidly. It is being partitioned or sub partitioned into different specialties. However, most of the machine learning tasks can be grouped under two major categories,
  • Supervised Machine Learning
  • Unsupervised Machine Learning
Let’s understand both one by one,

Supervised Machine Learning

In supervised learning, the machine learning algorithm is supplied with the labeled data to train the algorithm, which means that every data input is tagged with a labeled output. The learning algorithm accepts training data that contains a set of inputs referred to as Features, with the corresponding outputs referred to as Labels or Classes. The algorithm learns by comparing its actual production with correct outputs to find errors. It then modifies the model accordingly.
Let’s understand this with an example.
Introduction to Machine Learning and ML.Net
Figure. Supervised Machine Learning
As shown in the above figure, in this example we want to predict whether the player will play tennis or not given the different weather conditions (Outlook, Temperature, Humidity, and Windy). To find this, we are feeding a bunch of input data having corresponding labels with them into the supervised ML algorithm. The algorithm builds the ML model which takes the new values for the features and predicts the output label.
The supervised learning can also be divided into two main parts,
  • Classification
    A classification problem is when the output variable is a category, such as “Spam” and “Not Spam” or “Cat” and “Dog”. Classification can again be subdivided into two categories.

    • Binary Classification
      When the output variable/label has only two values. E.g. “Yes” and “No”

    • Multi-class Classification
      When the output variable/Label has more than two values. E.g., “Red”, “Blue”, “Yellow” and “White”.

  • Regression
    Regression problem is when the output variable is a real value in a continuous form, such as Price.

Unsupervised Machine Learning

In unsupervised learning, unlabeled data is used to train the ML algorithm, which means we supply the data only having features without any tagging of historical labels. The purpose is to explore the data and figure out the pattern in it. The algorithm figures out the data and according to the data segments, it makes clusters of data with new labels.
Introduction to Machine Learning and ML.Net
Figure. Unsupervised Machine Learning
In this example, we have row data having objects of different shapes like Rectangle, hexagon, triangle, circles, and square but, we do not know which object belongs to what shape. When this row data is passed to the ML algorithm, it finds the pattern in the objects and group them into different clusters of shapes and label them. There are two main types of unsupervised learning,
  • Clustering
    A clustering problem is where you want to discover the inherent groupings in the data, such as grouping customers by purchasing behavior.
  • Association
    An association rule learning problem is where you want to discover rules that describe large portions of your data. E.g. people that buy House also tend to buy Car.


Machine learning has a vast range of applications. We might not realize it but mostly we use machine learning in our daily life. Below are some of the major applications of ML but not limited to these,
  • Image recognition
  • Sentiment Analysis
  • Email Classification
  • Spam filtering
  • Speech Recognition
  • Self Driving Cars
  • Video Surveillance
  • Movie Recommendation
  • Product Recommendation
  • Virtual Personal Assistant
  • Fraud detection
  • News classification etc, etc

ML.Net Introduction

ML.NET is a free, cross-platform, open-source machine learning framework provided by Microsoft. It is made specifically for the .NET community. With the help of ML.Net framework, we can easily implement and integrate machine learning features into our existing or new .net applications. We can either use the ready-made models present in the framework or build the customized machine learning models in ML.Net. To start working on ML.Net, you don’t have to be a machine learning expert. You can just start building simple ML applications while teaching yourself. In my next article, I am going to give a demo of a simple yet exciting ML.Net based project. So for more information about ML.Net with a working example stay tuned for the next blog 😊.
Thanks for Reading !!!!

Similar Articles