0% found this document useful (0 votes)
27 views

Module

The document discusses machine learning types including supervised learning, unsupervised learning, and reinforcement learning. Supervised learning uses labeled training data to learn a function that maps inputs to outputs. Unsupervised learning identifies patterns in unlabeled data. Reinforcement learning involves an agent learning through trial-and-error interactions with a dynamic environment.

Uploaded by

warlord a
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

Module

The document discusses machine learning types including supervised learning, unsupervised learning, and reinforcement learning. Supervised learning uses labeled training data to learn a function that maps inputs to outputs. Unsupervised learning identifies patterns in unlabeled data. Reinforcement learning involves an agent learning through trial-and-error interactions with a dynamic environment.

Uploaded by

warlord a
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

CSA2001 - FUNDAMENTALS IN AI and ML

UNIT V Introduction to Machine Learning


Learning – Types of Machine Learning – Supervised Learning –
Reinforcement Learning - The Brain and the Neuron – Design a
Learning System – Perspectives and Issues in Machine Learning –
Concept Learning Task – Concept Learning as Search – Finding a
Maximally Specific Hypothesis –Version Spaces and the Candidate
Elimination Algorithm – Linear Discriminants – Perceptron – Linear
Separability – Linear Regression.
Prepared by
Dr M.Manimaran
Associate Professor (Grade-2)
School of Computing Science and Engineering
VIT Bhopal University
Learning
• What Is Machine Learning?
• Machine learning is programming computers to optimize a performance criterion
using example data or past experience. We have a model defined up to some
parameters, and learning is the execution of a computer program to optimize the
parameters of the model using the training data or past experience.
• The model may be predictive to make predictions in the future, or descriptive to gain
knowledge from data, or both. Arthur Samuel, an early American leader in the field of
computer gaming and artificial intelligence, coined the term “Machine Learning” in
1959 while at IBM.
• He defined machine learning as “the field of study that gives computers the ability to
learn without being explicitly programmed.” However, there is no universally
accepted definition for machine learning.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Learning
• Examples of Learning
• i) Handwriting recognition learning problem
• • Task T: Recognising and classifying handwritten words within images
• • Performance P: Percent of words correctly classified
• • Training experience E: A dataset of handwritten words with given classifications
• ii) A robot driving learning problem
• • Task T: Driving on highways using vision sensors
• • Performance measure P: Average distance traveled before an error
• • training experience: A sequence of images and steering commands recorded while
observing a human driver
• iii) A chess learning problem
• • Task T: Playing chess • Performance measure
• P: Percent of games won against opponents
• • Training experience E: Playing practice games against itself
• Definition: A computer program which learns from experience is called a machine learning
program or simply a learning program. Such a program is sometimes also referred to as a
Unit - V Introduction to Machine Learning / Dr Subash Chandra
learner. Bose
Learning
• Components of Learning: Basic components of learning process
• The learning process, whether by a human or a machine, can be divided into four
components, namely, data storage, abstraction, generalization and evaluation.
• Figure illustrates the various components and the steps involved in the learning process.

• 1. Data storage
• Facilities for storing and retrieving huge amounts of data are an important component of the
learning process. Humans and computers alike utilize data storage as a foundation for advanced
reasoning.
• In a human being, the data is stored in the brain and data is retrieved using electrochemical
signals.
• Computers use hard disk drives, flash memory, random access memory and similar devices
to store data and use cables Unit
and other technology
- V Introduction to Machine Learningto
Bose
/ Drretrieve data.
Subash Chandra
Learning
• 2. Abstraction
• The second component of the learning process is known as abstraction. Abstraction is the
process of extracting knowledge about stored data. This involves creating general concepts
about the data as a whole. The creation of knowledge involves application of known models
• and creation of new models.
• The process of fitting a model to a dataset is known as training. When the model has been
trained, the data is transformed into an abstract form that summarizes the original
information.

• 3. Generalization
• The third component of the learning process is known as generalization. The term
generalization describes the process of turning the knowledge about stored data into a form
that can be utilized for future action. These actions are to be carried out on tasks that are
similar, but not identical, to those what have been seen before. In generalization, the goal is
to discover those properties of the data that will be most relevant to future tasks.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Learning
• 4. Evaluation
• Evaluation is the last component of the learning process. It is the process of giving feedback
to the user to measure the utility of the learned knowledge. This feedback is then utilized to
effect improvements in the whole learning process

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning
•Types of Learning: In general, machine learning algorithms can be classified into three types.
✔ Supervised learning
✔ Unsupervised learning
✔ Reinforcement learning
✔ 1. Supervised learning
✔ A training set of examples with the correct responses (targets) is provided and, based on this
training set, the algorithm generalizes to respond correctly to all possible inputs. This is also
called learning from exemplars. Supervised learning is the machine learning task of learning a
function that maps an input to an output based on example input-output pairs.
✔ In supervised learning, each example in the training set is a pair consisting of an input object
(typically a vector) and an output value.
✔ A supervised learning algorithm analyzes the training data and produces a function, which
can be used for mapping new examples. In the optimal case, the function will correctly
determine the class labels for unseen instances. Both classification and regression problems
are supervised learning problems.
✔ A wide range of supervised learning algorithms are available, each with its strengths and
weaknesses. There is no single learning algorithm that works best on all supervised learning
problems. Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Types of Machine Learning

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning
✔ 1. Supervised learning
✔ A “supervised learning” is so called because the process of an algorithm learning from the
training dataset can be thought of as a teacher supervising the learning process. We know
the correct answers (that is, the correct outputs), the algorithm iteratively makes predictions
on the training data and is corrected by the teacher. Learning stops when the algorithm
achieves an acceptable level of performance.
✔ Example
✔ Consider the following data regarding patients entering a clinic. The data consists of the
gender and age of the patients and each patient is labeled as “healthy” or “sick”.

Supervised vs Unsupervised vs Reinforcement Learning


https://youtu.be/xtOg44r6dsE

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning
✔ 2. Unsupervised learning

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Types of Machine Learning
✔ 2. Unsupervised learning
✔ Correct responses are not provided, but instead the algorithm tries to identify similarities
between the inputs so that inputs that have something in common are categorized together.
✔ The statistical approach to unsupervised learning is known as density estimation.
✔ Unsupervised learning is a type of machine learning algorithm used to draw inferences from
datasets consisting of input data without labeled responses. In unsupervised learning
algorithms, a classification or categorization is not included in the observations. There are no
output values and so there is no estimation of functions.
✔ Since the examples given to the learner are unlabeled, the accuracy of the structure that is
output by the algorithm cannot be evaluated. The most common unsupervised learning
method is cluster analysis, which is used for exploratory data analysis to find hidden patterns
or grouping in data.
✔ Example : Consider the following data regarding patients entering a clinic. The data consists
of the gender and age of the patients.

✔ Based on this data, can we infer anything regarding the patients


entering the clinic?
Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Types of Machine Learning
✔ 3. Reinforcement learning
✔ This is somewhere between supervised and unsupervised learning. The algorithm gets told
when the answer is wrong, but does not get told how to correct it. It has to explore and try
out different possibilities until it works out how to get the answer right.
✔ Reinforcement learning is sometime called learning with a critic because of this monitor that
scores the answer, but does not suggest improvements.
✔ Reinforcement learning is the problem of getting an agent to act in the world so as to
maximize its rewards. A learner (the program) is not told what actions to take as in most
forms of machine learning, but instead must discover which actions yield the most reward by
trying them. In the most interesting and challenging cases, actions may affect not only the
immediate reward but also the next situations and, through that, all subsequent rewards.
✔ Example: Consider teaching a dog a new trick: we cannot tell it what to do, but we can
reward/punish it if it does the right/wrong thing. It has to find out what it did that made it get
the reward/punishment. We can use a similar method to train computers to do many tasks,
such as playing backgammon or chess, scheduling jobs, and controlling robot limbs.
✔ Reinforcement learning is different from supervised learning. Supervised learning is learning
from examples provided by a knowledgeable expert.
Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Types of Machine Learning

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
The Brain and the Neuron

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
The Brain and the Neuron
✔ Dendrite — It receives signals from other neurons.
✔ Soma (cell body) — It sums all the incoming signals to generate input.
✔ Axon — When the sum reaches a threshold value, neuron fires and the signal travels down
the axon to the other neurons.
✔ Synapses — The point of interconnection of one neuron with other neurons. The amount of
signal transmitted depends upon the strength (synaptic weights) of the connections.
✔ The connections can be inhibitory (decreasing strength) or excitatory (increasing strength) in
nature.
✔ So, neural network, in general, is a highly interconnected network of billions of neuron with
trillion of interconnections between them.

Neural Network: https://youtu.be/vpOLiDyhNUA

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Design a Learning System
✔ According to Arthur Samuel “Machine Learning enables a Machine to Automatically learn
from Data, Improve performance from an Experience and predict things without explicitly
programmed.”
✔ In Simple Words, When we fed the Training Data to Machine Learning Algorithm, this
algorithm will produce a mathematical model and with the help of the mathematical model,
the machine will make a prediction and take a decision without being explicitly programmed.
✔ Also, during training data, the more machine will work with it the more it will get experience
and the more it will get experience the more efficient result is produced.

https://youtu.be/voKs59e1FQ8

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Design a Learning System
✔ Example: In Driverless Car, the training data is fed to Algorithm like how to Drive Car in
Highway, Busy and Narrow Street with factors like speed limit, parking, stop at signal etc.
After that, a Logical and Mathematical model is created on the basis of that and after that,
the car will work according to the logical model. Also, the more data the data is fed the more
efficient output is produced.

✔ According to Tom Mitchell, “A computer program is said to be learning from experience (E),
with respect to some task (T). Thus, the performance measure (P) is the performance at task
T, which is measured by P, and it improves with experience E.”
✔ Example: In Spam E-Mail detection,
✔ Task, T: To classify mails into Spam or Not Spam.
✔ Performance measure, P: Total percent of mails being correctly classified as being “Spam” or
“Not Spam”.
✔ Experience, E: Set of Mails with label “Spam”

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Design a Learning System
✔ Steps for Designing Learning System are:
Step 1. Choosing the Training Experience: The very
important and first task is to choose the training data
or training experience which will be fed to the
Machine Learning Algorithm. It is important to note
that the data or experience that we fed to the
algorithm must have a significant impact on the
Success or Failure of the Model. So Training data or
experience should be chosen wisely.

Step 2. Choosing target function: The next important step is choosing the target function. It means
according to the knowledge fed to the algorithm the machine learning will choose NextMove function
which will describe what type of legal moves should be taken. For example : While playing chess with the
opponent, when opponent will play then the machine learning algorithm will decide what be the number
of possible legal moves taken in order to get success.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Design a Learning System
Step 3- Choosing Representation for Target function: When the machine algorithm will know all the
possible legal moves the next step is to choose the optimized move using any representation i.e.
using linear Equations, Hierarchical Graph Representation, Tabular form etc. The NextMove function
will move the Target move like out of these move which will provide more success rate. For Example
: while playing chess machine have 4 possible moves, so the machine will choose that optimized
move which will provide success to it.
Step 4- Choosing Function Approximation Algorithm: An optimized move cannot be chosen just with
the training data. The training data had to go through with set of example and through these
examples the training data will approximates which steps are chosen and after that machine will
provide feedback on it. For Example : When a training data of Playing chess is fed to algorithm so at
that time it is not machine algorithm will fail or get success and again from that failure or success it
will measure while next move what step should be chosen and what is its success rate.
Step 5- Final Design: The final design is created at last when system goes from number of examples ,
failures and success , correct and incorrect decision and what will be the next step etc. Example:
DeepBlue is an intelligent computer which is ML-based won chess game against the chess expert
Garry Kasparov, and it became the first computer which had beaten a human chess expert.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Perspectives and Issues in Machine Learning
✔ One useful perspective on machine learning is that it involves searching a very large space of
possible hypotheses to determine one that best fits the observed data and any prior knowledge
held by the learner.
✔ For example, consider the space of hypotheses that could in principle be output by the above
checkers learner. This hypothesis space consists of all evaluation functions that can be
represented by some choice of values for the weights wo through w6. The learner's task is thus to
search through this vast space to locate the hypothesis that is most consistent with the available
training examples.
✔ The LMS algorithm for fitting weights achieves this goal by iteratively tuning the weights, adding a
correction to each weight each time the hypothesized evaluation function predicts a value that
differs from the training value. This algorithm works well when the hypothesis representation
considered by the learner defines a continuously parameterized space of potential hypotheses.
✔ These different hypothesis representations are appropriate for learning different kinds of target
functions. For each of these hypothesis representations, the corresponding learning algorithm
takes advantage of a different underlying structure to organize the search through the hypothesis
space.
✔ https://youtu.be/ngERnNlPyJI
Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Perspectives and Issues in Machine Learning
✔ Issues in Machine Learning
✔ What algorithms exist for learning general target functions from specific training examples?
In what settings will particular algorithms converge to the desired function, given sufficient
training data? Which algorithms perform best for which types of problems and
representations?
✔ How much training data is sufficient? What general bounds can be found to relate the
confidence in learned hypotheses to the amount of training experience and the character of
the learner's hypothesis space?
✔ When and how can prior knowledge held by the learner guide the process of generalizing
from examples? Can prior knowledge be helpful even when it is only approximately correct?
✔ What is the best strategy for choosing a useful next training experience, and how does the
choice of this strategy alter the complexity of the learning problem?
✔ What is the best way to reduce the learning task to one or more function approximation
problems? Put another way, what specific functions should the system attempt to learn? Can
this process itself be automated?
✔ How can the learner automatically alter its representation to improve its ability to represent
and learn the target function? Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Perspectives and Issues in Machine Learning
7 Major Challenges Faced By Machine Learning Professionals
✔ 1. Poor Quality of Data
✔ Data plays a significant role in the machine learning process. One of the significant issues that
machine learning professionals face is the absence of good quality data. Unclean and noisy
data can make the whole process extremely exhausting. We don’t want our algorithm to
make inaccurate or faulty predictions.
✔ 2. Underfitting of Training Data
✔ This process occurs when data is unable to establish an accurate relationship between input
and output variables. It simply means trying to fit in undersized jeans. It signifies the data is
too simple to establish a precise relationship. To overcome this issue:
✔ Maximize the training time
✔ Enhance the complexity of the model
✔ Add more features to the data
✔ Reduce regular parameters
✔ Increasing the training time of model
Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Perspectives and Issues in Machine Learning
✔ 3. Overfitting of Training Data
✔ Overfitting refers to a machine learning model trained with a massive amount of data that
negatively affect its performance. It is like trying to fit in Oversized jeans. Unfortunately, this
is one of the significant issues faced by machine learning professionals.
✔ 4. Machine Learning is a Complex Process
✔ The machine learning industry is young and is continuously changing. Rapid hit and trial
experiments are being carried on. The process is transforming, and hence there are high
chances of error which makes the learning complex. It includes analyzing the data, removing
data bias, training data, applying complex mathematical calculations, and a lot more. Hence it
is a really complicated process which is another big challenge for Machine learning
professionals.
✔ 5. Lack of Training Data
✔ The most important task you need to do in the machine learning process is to train the data
to achieve an accurate output. Less amount training data will produce inaccurate or too
biased predictions. Let us understand this with the help of an example. Consider a machine
learning algorithm similar to training a child.
Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Perspectives and Issues in Machine Learning
✔ 6. Slow Implementation
✔ This is one of the common issues faced by machine learning professionals. The machine
learning models are highly efficient in providing accurate results, but it takes a tremendous
amount of time.
✔ 7. Imperfections in the Algorithm When Data Grows
✔ So you have found quality data, trained it amazingly, and the predictions are really concise
and accurate. you have learned how to create a machine learning algorithm!! But wait, there
is a twist; the model may become useless in the future as data grows.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task

“Problem of searching through a predefined space of potential hypotheses for the hypothesis that
best fits the training examples”

https://youtu.be/jV0LpWF6UgY

https://youtu.be/kCvTeckjkn0 Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task

Assume that we have collected data for some attributes/features of the day like, Sky, Air Temperature,
Humidity, Wind, Water, Forecast. Let these set of instances be denoted by X and many concepts can
defined over the X. For example, the concepts can be - Days on which my friend Sachin enjoys his favorite
water sport - Days on which my friend Sachin will not go outside of his house.
Target concept — The concept or function to be learned is called the target concept and denoted by c. It
can be seen as a boolean valued function defined over X and can be represented as c: X → {0, 1}.
For the target concept c , “Days on which my friend Sachin enjoys his favorite water sport”, an attribute
EnjoySport is included in the below dataset X and it indicates whether or not my friend Sachin enjoys his
favorite water sport on that day.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task
Now the target concept is EnjoySport : X →{0,1}. With this, a learner task is to learn to predict the
value of EnjoySport for arbitrary day, based on the values of its attribute values.
When a new sample with the values for attributes <Sky, Air Temperature, Humidity, Wind, Water,
Forecast> is given, the value for EnjoySport (ie. 0 or 1) is predicted based on the previous learning.
Let H denote the set of all possible hypotheses that the learner may consider regarding the identity
of the target concept. So H = {h1, h2, …. }.

What hypothesis representation shall we provide to the learner in this case?


Let us begin by considering a simple representation in which each hypothesis
consists of a conjunction of constraints (and operation) on the instance attributes.
Let each hypothesis be a vector of six constraints, specifying the values of the six attributes <Sky, Air
Temperature, Humidity, Wind, Water, Forecast>.

In hypothesis representation, value of each attribute could be either


“?’ — that any value is acceptable for this attribute,
specify a single required value (e.g., Warm) for the attribute, or
“0” Ф that no value is acceptable.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task
For example :
the hypothesis that my friend Sachin enjoys his favorite sport only on cold days with high humidity
(independent of the values of the other attributes) is represented by the expression
< ?,cold, High,?, ? ,?>
Yes, No
The most general hypothesis (Yes, No) — < ?, ? , ? , ?, ? , ?> that every day is a positive example -> No
The most specific hypothesis — < 0, 0, 0, 0, 0, 0> that no day is a positive example. ->Yes

So far we looked into what is concept , target concept and concept learning. Also extended the
definition of concept, target concept and concept learning to an example where my friend Sachin
enjoys the water sport on certain day. Also looked into the hypothesis representation.

With this knowledge we can say, EnjoySport concept learning task requires learning the sets of days
for which EnjoySport=yes and then describing this set by a conjunction of constraints over the
instance attributes.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task
EnjoySport Concept Learning Task, The below points covers the simplified overview.
X — The set of items over which the concept is defined is called the set of instances, which we denote by X.
In the current example, X is the set of all possible days, each represented by the attributes Sky, AirTemp,
Humidity, Wind, Water, and Forecast.
c — The concept or function to be learned is called the target concept, which we denote by c. In general, c
can be any boolean valued function defined over the instances X; that is, c: X → {0, 1}. In the current
example, the target concept corresponds to the value of the attribute EnjoySport (i.e, c(x)=1 if
EnjoySport=Yes, and c(x)=0 if EnjoySport= No).
(x, c(x)) — When learning the target concept, the learner is presented by a set of training examples, each
consisting of an instance x from X, along with its target concept value c(x). Instances for which c(x) = 1 are
called positive examples and instances for which c(x) = 0 are called negative examples. We will often write
the ordered pair (x, c(x)) to describe the training example consisting of the instance x and its target concept
value c(x).
D — We use the symbol D to denote the set of available training examples.
H — Given a set of training examples of the target concept c, the problem faced by the learner is to
hypothesize, or estimate, c. We use the symbol H to denote the set of all possible hypotheses that the
learner may consider regarding the identity of the target concept.
h(x) — In general, each hypothesis h in H represents a Boolean-valued function defined over X; that is, h : X
→{0, 1}. The goal of the learner is to find a hypothesis h such that h(x) = c(x) for all x in X.
Unit - V Introduction to Machine Learning / Dr Subash Chandra
Bose
Concept Learning Task

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning Task
Notice that, the learning algorithm objective is to find a hypothesis h in H such that h(x) = c(x)
for all x in D.

We know that, the Inductive learning algorithm tries to induce a “general rule” from a set of
observed instances. So the above case is same as inductive learning where a learning algorithm
is trying to find a hypothesis h (general rule) in H such that h(x) = c(x) for all x in D. For a given
collection of examples, in reality, learning algorithm return a function h (hypothesis) that
approximates c (target concept). But the expectation is, the learning algorithm to return a
function h (hypothesis) that equals c (target concept) ie. h(x) = c(x) for all x in D.

So we can define, Inductive learning hypothesis is any hypothesis found to approximate the
target function well over a sufficiently large set of training examples will also approximate the
target function well over any other unobserved examples.

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose
Concept Learning as Search

Unit - V Introduction to Machine Learning / Dr Subash Chandra


Bose

You might also like