Machine Learning Basics

Share this post

After reading this blog you will understand what actually Machine learning is, how it differs from AI and Deep learning, the applications of ML, the basic architecture of ML and several types of ML.
Machine Learning

Machine learning (ML) can be described as a study that comprises of several algorithms and models, used by the computer systems in order to effectively and efficiently perform certain tasks. Basically, Machine Learning (ML) derive the concepts from Artificial intelligence (AI), hence can be termed as a sub-domain of Artificial intelligence (AI). In machine learning the computer systems learn or acquire knowledge through experience. The ML based systems do not rely upon explicit instructions rather they use a data driven approach such as, the prediction is based on the dataset. The dataset has certain parameters and attributes. The ML model is trained on the dataset, and it learns different parameters of the dataset, its patterns and relationship among them. Afterwards it performs a prediction based on the knowledge acquired or learned from its training.

The application of Machine learning ranges from image and speech recognition to recommendation systems, from self-driving vehicles to traffic prediction, from medical diagnosis to drug manufacturing. In short, Machine Learning provides mind boggling applications ranging from daily use to mission critical systems.

How Machine Learning differs from Artificial Intelligence and Deep Learning

There are certain aspects in which ML differs from AI and DL. As mentioned above ML can be considered as a sub domain of AI but it differs from AI in such a way that AI involves programs that sense, reason, act and adapt whereas ML contains the algorithms that learn the patterns in the data. Similarly, Machine Learning provides the desired output from a given input, whereas Deep Learning reads the input and apply it to another data.

Basic architecture of Machine Learning

First of all you have to understand the given use case. Its better to know about the domain for which the use case is built. In the second step you have to gather and understand the data related to that use case. Several techniques are used for data gathering. After gathering of the data, the cleansing of the data is carried out, as the raw data contains both useful as well as un-useful information. Hence, it is necessary to clean the data. For, this several activities, such as data wrangling, handling the missing value if any and performing exploratory data analysis (EDA).

After cleansing of the data the next phase is Modelling phase, in which several modelling related tasks such as feature engineering, Model training and Model evaluation are performed. In feature engineering, the scaling of the data and feature selection is carried out, For this activity several techniques such as backward elimination method, correlation factors, PCA and domain knowledge.

Furthermore, for model training we select an algorithm and train the model with the selected features. The activity is Model evaluation which consist of the Accuracy of the model, confusion matrix and cross-validation. If the accuracy is not high, we tune the model…either by changing the algorithm used or by feature selection or by gathering more data. The accuracy tells us about the performance of the model.

Once a high accuracy is achieved the next phase is the deployment phase, in which the model is deployed in cloud or raspberry py etc. After deploying the model, we monitor the performance of the model. If the performance is good we go live with the model or if performance is not up to the mark we reiterate all process until our model performance becomes upto the mark.

It’s not done yet!!!

What if, after a few days, our model performs poorly because of new data.

Don’t worry!! In this case, we have to do all the process again by collecting new data and redeploying the model.

Types of Machine Learning

Machine learning can be termed as an art for extracting the useful information from the data. For this purpose one can encounter several types of learning in this field of study, among which the most popular learning types are supervised learning, un-supervised learning and reinforcement learning:

1. Supervised learning

In supervised learning the input data is known or labeled, and the algorithms learn on this labeled data and make predictions. For example, an image of a cat is given, and the task is to predict the correct label, for example which animal is in the picture (cat or a dog)?  So, here you can see that the input data was known or labeled i.e “image of a cat”.In supervised learning the simplest form is predicting the cases with “Yes or No”, which is known as a binary classification. Supervised learning is sub-categorized into two types:  Classification and Regression

1.1. Classification:

       Classification is a type of supervised learning problem in which the predicted output is a class label. For example we observe several inputs of plant image, and try to infer its class, either the plant is with disease or without disease, so here we have 2 classes, “Healthy plant” and “unhealthy plant”. Another example is the labelling of handwritten digits, where images of a handwritten digits is taken as a input and the output is the image of a digit with a label.

1.2. Regression:

Regression is a type of supervised learning, which involves the prediction of numerical labels. For example, predicting the number of road accidents based on the speed limit and type of road, similarly predicting the number of Corona patients based on their symptoms and test reports. 

2.Un-Supervised Learning

In unsupervised learning the input data is unlabeled and the algorithms learn the features of the provided input and make the predictions on the basis of the patterns of the features. For example, we are randomly given some images, and the task is to group the images of similar objects. So, here the images with similar objects would be placed close to each other and dissimilar far away. Hence, this organizing or clustering of the similar objects into one group without any label as an input is known as unsupervised learning. Un-supervised learning is sub-categorized into four types: Clustering, Visualization, Projection and density estimation.


2.1. Clustering

Clustering is a type of unsupervised learning in which the data is used to identify the clusters or groups of similar objects. In clustering the clusters of similar objects are formed. For example, grouping in terms of age of individuals who participated in the marathon.

2.2. Visualization

Visualization is another type of unsupervised learning in which the similar objects are placed closely to each other and dissimilar object are places far away. It involves the creation of plots from the data. For example, a chart can be created showing the number of people who buy the same product, or in restaurant the number of people who tend to order same kind of food.

2.3. Projection

This type of unsupervised learning involves reducing or minimizing the dimensionality of the data. For example PCA (Principal Component Analysis), where the complexity of the problem is reduced and the instances are visualized in a better way. Feature selection is another example of the projection, where the necessary and useful features are selected, whereas the less useful features are discarded.

2.4. Density estimation

Density estimation is the summarization of
the data distribution. It is another method to learn the patterns in the data.
It involves the distribution of data within the space. For Example inferring
the characteristics of population, based on a finite data.

3.Reinforcement Learning

In this type of learning, the agents learn by performing certain actions in the environment and receiving the feedback from the environment. The learning of the agent depends upon the interaction with the environment. The feedback can be a negative feedback or a positive feedback. For example, playing a game, if a certain goal is reached and a positive reward is given as a winner, whereas on choosing a wrong move the scores are deducted and a negative feedback is given. There are two types of reinforcement learning, positive reinforcement learning and negative reinforcement learning.

3.1. Positive Reinforcement Learning: A positive reinforcement learning involves the positive impact on action taken by the agent. It enables the maximization of performance.

3.2. Negative Reinforcement Learning : A negative reinforcement learning involves the behavior that appears due to negative conditions, which should have avoided. It enables to define minimum performance stand. 

The Other types of learning include:

4.       Hybrid Learning

In hybrid learning, some portion of the data is labeled and some portion of the data is unlabeled. The main aim of hybrid learning is to utilize all the data rather than using just labeled data as in supervised learning, or unlabeled data as in unsupervised learning. The techniques from both of the learning problems (supervised and unsupervised) are utilized in this learning. For example, many of the Natural language processing (text recognition) and computer vision (image processing) problems are solved using this type of learning.

5.       Active Learning

Active learning is also known as the passive supervised learning. In this type of learning the learner query the label form the operator for new data points. This type of learning focuses on elevating the accuracy of Machine learning algorithm with just minimum number of training labels.  It is used when there is only a small amount of data available and its expensive to collect more data. Example of this type of learning problem include the
application of computational biology.

6.       Transfer Learning

In this type of learning the model is trained on one task and it makes prediction for other related task. In transfer learning the tasks are learned sequentially. It is useful for the model that are trained incrementally and existing models are used as starting point. Example of this type of learning include image classification, where the model is trained on large dataset of general images and weights of the model are used as starting point when training on small dataset, as the feature are already learnt by the model so it makes the classification or prediction easier.

7.       Online Learning

When the data is continuously changing over time. It involves using the currently available data and update itself when new data is available. The model changes over time in order to capture the changes in the dataset. The learning is performed in increments. For example, In stochastic gradient decent the mini batches are drawn from stream of data.

Share this post

1 thought on “Machine Learning Basics”

Leave a Comment

Your email address will not be published. Required fields are marked *