CHAPTER 6
LEARNING IN AI
OUTLINE
Machine Learning
Need for Machine Learning
Classification of Machine Learning
Machine Learning Lifecycle
Applications of Machine Learning
MACHINE LEARNING
Machine Learning is a subset
of artificial intelligence.
It is mainly concerned with the
development of algorithms which
allow a computer to learn from the
data and past experiences on their
own.
The term machine learning was first
introduced by Arthur
Samuel in 1959.
Cont’d…
Machine learning enables a machine
to automatically learn from data,
improve performance from
experiences, and predict things
without being explicitly programmed.
How does Machine Learning work
ML learns from historical data,
builds the prediction models, and
whenever it receives new data,
predicts the output for it.
CONT’D…
The accuracy of predicted output
depends upon the amount of data.
CONT’D..
Suppose we have a complex problem,
where we need to perform some
predictions.
So instead of writing a code for it, we
just need to feed the data to generic
algorithms.
With the help of these algorithms,
machine builds the logic as per the data
and predict the output.
Machine learning has changed our way
of thinking about the problem.
Cont’d…
Features of Machine Learning:
Machine learning uses data to detect
various patterns in a given dataset.
It can learn from past data and
improve automatically.
It is a data-driven technology.
Machine learning is much similar to
data mining as it also deals with the
huge amount of the data.
NEED FOR MACHINE LEARNING
The reason behind the need for machine
learning is that it is capable of doing tasks
that are too complex.
The performance of the machine learning
algorithm depends on the amount of data,
and it can be determined by the cost
function.
Currently, machine learning is used
in self-driving cars, cyber fraud
detection, face recognition, and friend
suggestion by Facebook, etc.
Cont’d…
Some key points which show the
importance of machine learning
are:
Rapid increment in the production of
data
Solving complex problems, which are
difficult for a human
Decision making in various sector
including finance
Finding hidden patterns and
CLASSIFICATION OF MACHINE
LEARNING
At a broad level, machine learning
can be classified into three types:
1. Supervised learning
2. Unsupervised learning
3. Reinforcement learning
SUPERVISED MACHINE
LEARNING
Supervised learning is a type of machine
learning method in which we provide
sample labeled data to the machine
learning system in order to train it, and
on that basis, it predicts the output.
The goal of supervised learning is to map
input data with the output data.
The supervised learning is based on
supervision, and it is the same as when a
student learns things in the supervision
of the teacher.
CONT’D…
The example of supervised learning
is spam filtering.
Supervised learning can be grouped
further in two categories of
algorithms:
• Classification: the output variable must be a discrete
value.
• E.g. will it be cold or hot tomorrow?
• Regression: In Regression, the output variable must be of
continuous nature or real value.
• E.g. what is the temperature going to be tomorrow? Prediction 84 Celsius
CONT’D…
Advantages of Supervised learning:
• With the help of supervised learning,
the model can predict the output on
the basis of prior experiences.
• In supervised learning, we can have an
exact idea about the classes of objects.
• Supervised learning model helps us to
solve various real-world problems such
as fraud detection, spam filtering,
etc.
CONT’D…
Disadvantages of supervised learning:
• Supervised learning models are not
suitable for handling the complex tasks.
• Supervised learning cannot predict the
correct output if the test data is different
from the training dataset.
• Training required lots of computation
times.
• In supervised learning, we need enough
knowledge about the classes of object.
UNSUPERVISED LEARNING
Unsupervised learning is a learning method
in which a machine learns without any
supervision.
The training is provided to the machine with
the set of data that has not been labeled,
classified, or categorized, and the algorithm
needs to act on that data without any
supervision.
The goal of unsupervised learning is to
restructure the input data into new features
or a group of objects with similar patterns.
CONT’D…
In unsupervised learning, we don't
have a predetermined result.
The machine tries to find useful
insights from the huge amount of
data.
It can be further classifieds into two
categories of algorithms:
• Clustering
• Association
Cont’d…
Advantages of Unsupervised
Learning
• Unsupervised learning is used for
more complex tasks as compared to
supervised learning because, in
unsupervised learning, we don't
have labeled input data.
• Unsupervised learning is preferable
as it is easy to get unlabeled data in
comparison to labeled data.
CONT’D…
Disadvantages of Unsupervised
Learning
• Unsupervised learning is intrinsically
more difficult than supervised
learning as it does not have
corresponding output.
• The result of the unsupervised
learning algorithm might be less
accurate as input data is not labeled,
and algorithms do not know the
REINFORCEMENT LEARNING
Reinforcement learning is a feedback-
based learning method, in which a
learning agent gets a reward for each
right action and gets a penalty for each
wrong action.
The agent learns automatically with
these feedbacks and improves its
performance.
In reinforcement learning, the agent
interacts with the environment and
explores it.
CONT’D…
The goal of an agent is to get the
most reward points, and hence, it
improves its performance.
The robotic dog, which automatically
learns the movement of his arms, is
an example of Reinforcement
learning.
APPLICATIONS OF MACHINE
LEARNING
MACHINE LEARNING LIFE CYCLE
CONT’D…
1. Gathering Data
Data Gathering is the first step of the
machine learning life cycle.
The goal of this step is to identify
and obtain all data-related problems.
In this step, we need to identify the
different data sources such
as files, database, internet,
or mobile devices.
CONT’D…
The quantity and quality of the
collected data will determine the
efficiency of the output.
This step includes the following
tasks:
• Identify various data sources
• Collect data
• Integrate the data obtained from
different sources
CONT’D…
2. Data preparation
Data preparation is a step where we put
our data into a suitable place and
prepare it to use in our machine learning
training.
In this step, first, we put all data
together, and then randomize the
ordering of data.
This step can be further divided into
data exploration and data pre-
processing.
CONT’D…
3. Data Wrangling
Data wrangling is the process of cleaning
and converting raw data into a useable
format.
It is the process of cleaning the data,
selecting the variable to use, and
transforming the data in a proper format
to make it more suitable for analysis in
the next step.
Cleaning of data is required to address
the quality issues.
CONT’D…
In real-world applications, collected
data may have various issues,
including:
• Missing Values
• Duplicate data
• Invalid data
• Noise
CONT’D…
4. Data Analysis
This step involves:
• Selection of analytical techniques
• Building models
• Review the result
The aim of this step is to build a machine learning
model to analyze the data using various analytical
techniques and review the outcome.
CONT’D…
It starts with the determination of
the type of the problems, where we
select the machine learning
techniques such as
Classification,
Regression,
Cluster analysis,
Association, etc.
Cont’d…
5. Train Model
In this step, the model is trained to
improve its performance for better
outcome of the problem.
Datasets will be used to train the
model using various machine
learning algorithms.
Training a model is required so that it
can understand the various patterns,
rules, and, features.
Cont’d…
6. Test Model
Once the machine learning model
has been trained on a given dataset,
then it has to be tested.
In this step, we check for the
accuracy of our model by providing a
test dataset to it.
Testing the model determines the
percentage accuracy of the model as
per the requirement of project or
CONT’D…
7. Deployment
The last step of machine learning life cycle is
deployment, where we deploy the model in the
real-world system.
If the above-prepared model is producing an
accurate result as per our requirement with
acceptable speed, then we deploy the model in
the real system.
But before deploying the project, we will check
whether it is improving its performance using
available data or not.
The deployment phase is similar to making the
final report for a project.