Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

UNIT-5

Machine Learning
• Machine learning is a modern innovation that
has enhanced many industrial and
professional processes as well as our daily
lives.
• It's a subset of artificial intelligence (AI), which
focuses on using statistical techniques to build
intelligent computer systems to learn from
available databases
How does Machine Learning work
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

• self-driving cars,
• cyber fraud detection,
• face recognition,
• friend suggestion by Facebook, etc.
Machine Learning

• 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 extracting useful
information from data.
Classification of Machine Learning

• Supervised learning
• Unsupervised learning
• Reinforcement learning
Example

Feature
Supervised 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.
• Supervised learning can be grouped further in
two categories of algorithms:
Classification
Regression
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.
• It can be further classifieds into two categories of
algorithms:
Clustering
Association
Example
Example
Supervised learning

Unsupervised learning

Unsupervised learning

Supervised learning
Types of Supervised Learning
Reinforcement Learning
• Reinforcement learning is an area of Machine
Learning. It is about taking suitable action to
maximize reward in a particular situation.
• Reinforcement learning is all about making
decisions sequentially.
• In simple words, we can say that the output
depends on the state of the current input and
the next input depends on the output of the
previous input
Reinforcement Learning
• In Reinforcement learning decision is
dependent, So we give labels to sequences of
dependent decisions
Terms used in Reinforcement Learning

• Agent(): An entity that can perceive/explore the environment and act upon it.
• Environment(): A situation in which an agent is present or surrounded by. In RL,
we assume the stochastic environment, which means it is random in nature.
• Action(): Actions are the moves taken by an agent within the environment.
• State(): State is a situation returned by the environment after each action taken by
the agent.
• Reward(): A feedback returned to the agent from the environment to evaluate the
action of the agent.
• Policy(): Policy is a strategy applied by the agent for the next action based on the
current state.
• Value(): It is expected long-term retuned with the discount factor and opposite to
the short-term reward.
• Q-value(): It is mostly similar to the value, but it takes one additional parameter as
a current action ().
Elements of Reinforcement Learning

• Policy
• Reward Signal
• Value Function
• Model of the environment
Reinforcement Learning Applications
The Brain and the Neuron
• The human brain consists of neurons or nerve
cells which transmit and process the
information received from our senses. Many
such nerve cells are arranged together in our
brain to form a network of nerves. These
nerves pass electrical impulses i.e the
excitation from one neuron to the other.
The Brain and the Neuron
Design a Learning System in Machine Learning
Common issues in Machine Learning

1. Inadequate Training Data


2. Poor quality of data
3. Non-representative training data
4. Over fitting and Under fitting
5. Monitoring and maintenance
6. Getting bad recommendations
7. Lack of skilled resources
8. Customer Segmentation
9. Process Complexity of Machine Learning
10. Data Bias
11. Lack of Explain ability
12. Slow implementations and results
13. Irrelevant features
What is Learning?
• “The activity or process of gaining knowledge
or skill by studying, practicing, being taught,
or experiencing something”
Divide learning methods into five parts
• Rote Learning (memorization): Memorizing
things without knowing the concept/ logic behind
them
2. Passive Learning (instructions): Learning from
a teacher/expert.
3. Analogy (experience): Learning new things
from our past experience.
4. Inductive Learning (experience): On the basis
of past experience formulating a generalized
concept.
5. Deductive Learning: Deriving new facts from
past facts.
Hypothesis Notations:

Each of the data objects represents a concept and hypotheses.


Considering a hypothesis <true, true, false, false> is more
specific because it can cover only one sample. To make a more
generalized concept we can add some notations into this
hypothesis. To this task we have following notations:
• 1. ⵁ (Represents a hypothesis which rejects all.)
2. < ? , ? , ? , ? > (Accepts all)
3. <true, false, ? , ? > (Accepts some)
• The hypothesis ⵁ will reject all the data samples. The
hypothesis <? , ? , ? , ? > will accept all the data samples.
The ‘?’ notation indicates that the values of this specific
feature do not affect the result
Find-S Algorithm: Finding Maximally
Specific Hypothesis:
• To find out a single hypothesis defined on X
we can use the concept more-general-then
partial ordering. One way to do this is start
with the most specific hypothesis from H and
generalize this hypothesis each time it fails to
classify and observed positive training data
object as positive.
Steps of algorithm
• Step 1. The first step in Find-S algorithm is to start
with most specific hypothesis that can be
denoted by
h <- <ⵁ, ⵁ, ⵁ, ⵁ>
• Step 2. This step involves picking up next training
sample and apply step 3 on the sample.
• Step 3. The next step involves observing the data
sample. If the sample is negative the hypothesis
remains unchanged and we pick next training
sample by processing step 2 again else we
process step 4.
Cond…
• Step 4. If the sample is positive and we find that our initial hypothesis is
too specific because it does not cover the current training sample then we
need to update our current hypothesis. This can be done by the pairwise
conjunction (Logical AND operation) of current hypothesis and training
sample.
• If next training sample is <true, true, false, false> and current hypothesis
is <ⵁ, ⵁ, ⵁ, ⵁ>, then we can directly replace our existing hypothesis with
the new one.
• If the next positive training sample is<true, true, false, true> and current
hypothesis is <true, true, false, false> then we can perform a pairwise
conjunctive AND with the current hypothesis and next training sample and
find new hypothesis by putting ‘?’ in the place where the result of
conjunction is false:
<true, true, false, true> ⵁ<true, true, false, false> = <true, true, false,
?>
Now we can replace our existing hypothesis with the new one:
h <-<true, true, false, ?>
Cond…
• Step 5. This step involves repetition of step 2
till we have more training samples.
• Step 6. Once there are no training samples the
current hypothesis is the one we were trying to
find. We can use the final hypothesis for
classifying the real objects.
Example
Solution

most specific hypothesis


Example:2 Consider the following data set having the data about
which particular seeds are poisonous.
Example 3
Limitations of the Find-S algorithm:
1. No way to determine if the only final hypothesis (found
by Find-S) is consistent with data or there are more
hypothesis that is consistent with data.
2. Inconsistent sets of training examples can mislead the
finds algorithm as it ignores negative data samples, so an
algorithm that can detect inconsistency of training data
would be better to use.
3. A good concept learning algorithm should be able to
backtrack the choice of hypothesis found so that the
resulting hypothesis can be improved over time.
Unfortunately, Find-S provide no such method.
Example
Example
Example
Example
Example

You might also like