B. Fundamentals of Machine Learning (ML), Deep Learning (DL) and Artificial Neural Networks (ANN)…

Source: Deep Learning on Medium

B. Fundamentals of Machine Learning (ML), Deep Learning (DL) and Artificial Neural Networks (ANN) (###4)

What is Machine Learning (ML)?

Machine Learning (ML) is an approach to achieve intelligence through system or software model that can learn from experience to find patterns in a set of data. It is an application of Artificial Intelligence. It has ability to learn from experience. It recognizes data patterns and creates rules rather than traditional programming.

Process of Machine Learning (ML)

Training data and Test data are two important concepts in machine learning.

Training data consist of both the input data along with the corresponding expected output. This provides your model with “ground truth” data that’s usually prepared by humans or in a semi-automated way. During the training phase, you present this data to train your model by pairing the input with its respective desired output.

Test data consist of actual working of your model. In contrast, this data doesn’t have any “expected” output. During the test phase of machine learning, this data is used to make prediction based on how well your model has been trained and to estimate model properties.



Let us assume that you have to make a model which predicts whether signal is Red or Green! So, in Training phase we will give training data to the model. This training data consist of Input with Expected output.

Input:🔴 Output: RED
Input:🟢 Output: GREEN

Model studies the data pattern and find logic for output through algorithm. This logic and data pattern is learned data for the model.Now, in Testing phase Model detects the signal colour and predict colour based on patterns and logic learned in the training process.


Machine learning is sub-categorized to four types:

  • Supervised Learning
  • Unsupervised Learning
  • Semi-supervised Learning
  • Reinforcement Learning

Supervised Learning

When a machine learning model is provided with labelled data set then it is referred as Supervised Learning. Labelled data set is one which have both input and output parameters.

Both of above figures have labelled data sets.

  • Figure (A)
    It consist of data set of a shopping store, which is useful in predicting whether a customer will purchase a particular product under consideration or not based on his/ her gender, age and salary. Input: Gender, Age, Salary. Output: Purchased i.e. 0 or 1 (0 means that customer won’t purchase it and 1 means yes the customer will purchase)
  • Figure (B)
    It is a Meteorological data set, which serves the purpose of predicting wind speed based on different parameters. Input: Dew Point, Temperature, Pressure, Relative Humidity, Wind Direction Output: Wind Speed

While training the model, data is usually split in the ratio of 80:20
i.e. 80% as training data and rest as testing data.
In training data, we feed input as well as output for 80% data. The model learns from training data only.
We use different machine learning algorithm to build our model. By learning, it means that the model will build some logic of its own.
Once the model is ready then it is good to be tested.
At the time of testing, input is fed from remaining 20% data which the model has never seen before, the model will predict some value and we will compare it with actual output and calculate the accuracy.

Types of Supervised Learning:


It is a Supervised Learning task where output is having defined labels (discrete value).

Output: Purchase has defined labels i.e. 0 or 1.
The goal here is to predict discrete values belonging to a particular class and evaluate on the basis of accuracy.
It can be either binary or multi class classification.
In binary classification, model predicts either 0 or 1 (Yes or No) but in case of multi class classification, model predicts more than one class.

Classifying whether a patient has disease or not
classifying whether an email is spam or not
Gmail classifies mails in more than one classes (social, promotions, updates, forum)


It is a Supervised Learning task where output is having continuous value.

Output: Wind Speed
Wind Speed is not having any discrete value but is continuous in the particular range.
The goal here is to predict a value as much closer to actual output value as our model can and then evaluation is done by calculating error value. The smaller the error the greater the accuracy of our regression model.

Predicting house/property price
Predicting stock market price

Unsupervised Learning

When a machine learning model is provided with unlabeled data set then it is referred as Unsupervised Learning.
Unsupervised machine learning finds all kind of unknown patterns in data.
Unsupervised methods help you to find features which can be useful for categorization.
It is taken place in real time, so all the input data to be analyzed and labeled in the presence of learners.
It is easier to get unlabeled data from a computer than labeled data, which needs manual intervention.

Let’s, take the case of a baby and her family dog.
She knows and identifies her dog
Few weeks later a family friend brings another dog and tries to play with baby.
Baby has not seen this dog earlier. But it recognizes many features (2 ears, eyes, walking on 4 legs) are like her pet dog. She identifies the new animal as a dog.
This is unsupervised learning, where you are not taught but you learn from the data (in this case data about a dog.)

Difference between Supervised and Unsupervised Machine Learning

Types of Unsupervised Learning

Unsupervised learning problems further grouped into Clustering and Association problems.


Clustering deals with finding a structure or pattern in a collection of unlabeled data.Clustering algorithms will process your data and find natural clusters(groups) if they exist in the data.
You can also modify how many clusters your algorithms should identify.

How cluster actually works!

Clustering Types

Hierarchical clustering
K-means clustering
K-NN (k nearest neighbors)
Principal Component Analysis
Singular Value Decomposition
Independent Component Analysis


This unsupervised technique is about discovering interesting relationships between variables in large databases.

{Onions, Potatoes}➡ {Burger}
Found in the sales data of a supermarket would indicate that if a customer buys onions and potatoes together, they are likely to also buy hamburger meat.
People that buy a new home most likely to buy new furniture.

Semi Supervised Learning

In Semi Supervised Learning, the algorithm is trained upon a combination of labeled and unlabeled data. Typically, this combination will contain a very small amount of labeled data and a very large amount of unlabeled data.
The basic procedure involved is that first, the programmer will cluster similar data using an unsupervised learning algorithm and then use the existing labeled data to label the rest of the unlabeled data.
The acquisition of unlabeled data is relatively cheap while labeling the said data is very expensive.

Speech analysis is a classic example of the value of semi-supervised learning models . Labeling audio files typically is a very intensive tasks that requires a lot of human resources. Applying Semi Supervised Learning techniques can really help to improve traditional speech analytic models.

Reinforcement Learning

Reinforcement Learning is an approach to automating goal-oriented learning and decision-making. This approach is meant for solving problems in which an agent interacts with an environment and receives a reward signal at the successful completion of every step. Reinforcement Learning algorithms aim to find a policy, which means a mapping from state to action, which maximizes the expected cumulative reward (value function) under that policy.

The reward Rₜ is a scalar feedback signal which indicates how well the agent is doing at step time t. In reinforcement learning we need define our problem such that it can be applied to satisfy our reward hypothesis.

You may start with a blank slate, and then strive to reach the goal, under the right conditions. Just like a whiz kid tries out different ways to achieve his goals, through trial and error, learning from his mistakes, Reinforcement Learning is attaining success through a series of steps. These steps may vary widely from problem to problem. But the result is the same; making the right decisions and getting rewarded when you make the right ones — this is reinforcement.

What is Deep Learning (DL)?

Deep learning is a sub-field of machine learning dealing with algorithms inspired by the structure and function of the brain called artificial neural networks. In other words, It mirrors the functioning of our brains. Deep learning algorithms are similar to how nervous system structured where each neuron connected each other and passing information.
Deep learning models tend to perform well with amount of data where as old machine learning models stops improving after a saturation point.

One of differences between machine learning and deep learning model is on the feature extraction area. Feature extraction is done by human in machine learning whereas deep learning model figure out by itself.

What is Artificial Neural Networks (ANN)?

Artificial Neural Network (ANN) is exactly what it says in the name. It is a network of neurons that are used to process information. To create these, scientists looked at the most advanced data processing machine at the time (brain). Our brains process information using networks of neurons. They receive an input, process it, and accordingly output electric signals to the neurons it is connected to. Using bio-mimicry, we were able to apply the architecture of our brains to further the field of artificial intelligence.

Artificial neural networks recreate the structure of human neurons to process information resulting in much more accurate results than previously used regression models.

Parts of Artificial Neural Networks (ANN)

  1. Input Layer
  2. Hidden Layers
  3. Output Layer

Input Layer
This is literally the layer that inputs information for the neural network to process. Each circle represents 1 feature (a piece of information). This can be anything. It could be the square footage of your house for a house price prediction program, or the value of a pixel on a screen for a computer vision program.

Hidden Layers
These layers do all the processing for neural networks. You can have as many of these as you want. Generally speaking, the more hidden layers you have, the more accurate the neural network will be. Each layer consists of nodes that mimic our brains’ neurons. These nodes receive information from the previous layer’s nodes, multiply it by weight and then add a bias to it. Each line in the diagram represents a weight.

That may sound confusing so here’s an analogy:
Let’s say I want to predict my SAT score and I have gathered two pieces of data: the number of hours I prepared, and the breakfast I had on the day of the test. These would go into the input layer. It’s quite obvious that the hours I spend preparing will have a much greater impact on my mark than my breakfast (or everyone would ace the SAT). Because of this, the hours I spend studying receive a significantly larger weight value to be multiplied by. Now, granted, there’s a chance that your breakfast may very slightly impact your score, so it will receive a much lower weight value.

Output Layer
This layer simply brings together the information from the last hidden layer of the network to output all the information you need from the program. To sum up, neural networks take information from the input layer, process it in the hidden layers, and output the desired information in the output layer. This whole process of running a neural network is called forward propagation.

Make sure you follow my blog to read and learn all contents mentioned above.