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

Chapter - 5 Learning

The document discusses various types of learning in artificial intelligence, including supervised, unsupervised, and reinforcement learning, as well as their applications and methodologies. It explains the structure of learning agents, decision tree learning, and the differences between inductive and deductive learning. Additionally, it covers the basics of artificial neural networks and their types, emphasizing the importance of learning in adapting to unknown environments.

Uploaded by

lidelidetuwatiro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Chapter - 5 Learning

The document discusses various types of learning in artificial intelligence, including supervised, unsupervised, and reinforcement learning, as well as their applications and methodologies. It explains the structure of learning agents, decision tree learning, and the differences between inductive and deductive learning. Additionally, it covers the basics of artificial neural networks and their types, emphasizing the importance of learning in adapting to unknown environments.

Uploaded by

lidelidetuwatiro
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

1

Chapter 3
Learning
Topics we will cover
2

 Learning
 Learning agents
 Inductive learning
 Deductive learning
 Decision tree learning
Introduction
3

 As humans, we start learning on our first day of existence.


 Most of this initial learning happens through observation.
 Observing friends,
 family members, and
 the surrounding environment.
 That’s how we make sense of the world.
 Observational learning is the process of learning by
watching the behaviors of others. The targeted behavior is
watched, memorized, and then mimicked.
 Also known as shaping and modeling, observational
learning is most common in children as they imitate
behaviors of adults.
Learning
4

 Learning is essential for unknown environments,


 i.e., when designer lacks omniscience.
 Omniscience (all-knowing with infinite knowledge).
 An agent is autonomous if its behavior is determined by
its own experience. (with ability to learn and adapt).
 Learning is useful as a system construction method,
 i.e., expose the agent to reality rather than trying to write it

down.
 Learning modifies the agent's decision mechanisms to
improve performance.
Learning agents
5

Learning agents
A learning agent can be divided into four
conceptual components:

•Performance Element can be replaced


with any of the 4 agent types .

•The Learning Element is responsible for


suggesting improvements to any part of the
performance element.

•The input to the learning element comes


from the Critic.
Figure - The basic structure of a learning
•The Problem Generator is responsible for agent
suggesting actions that will result in new
knowledge about the world being acquired.
Learning element
6

 Design of a learning element is affected by:


 Which components of the performance element should be
modified?
 What feedback is available to guide the learning process?
 How is the performance element represented?
 Type of learning process:
 Depending on the answer to this question, we can define
three types of learning process:
Learning element
7

 Supervised learning: correct answers for each example.


 The agent learns a function from examples of its inputs and outputs.
 Unsupervised learning: correct answers not given.
• The agent learns patterns in the inputs, without actually knowing
what the correct output should be.
 Reinforcement learning: occasional rewards.
• The outputs of the function are not explicitly specified, but the agent
may get an occasional reward for doing good things.
1. Supervised learning:
8
 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 system creates a model using labeled data to understand the


datasets and learn about each data.
 Once the training and processing are done then we test the model by
providing sample data to check whether it is predicting the exact
output or not.
Cont...
9
This type of machine learning are good for the following tasks:
 Binary classification: deviding data into two catagories.
 Multi-class classification: choosing between morethan two types
of answers.
 Regression modelling: predicting continous values.
 Ensembling: combining prediction of multiple machine learning
models to produce an accurate prediction.
 Supervised learning can be grouped further in to Classification
and Regression algorithms:
Cont...
10
1. Regression
 Regression algorithms are used if there is a relationship between the
input variable and the output variable. It is used for the prediction of
continuous variables, such as Weather forecasting, Market Trends,
etc. Some popular Regression algorithms are; Linear Regression,
Non-Linear Regression, Bayesian Linear Regression etc..
2. Classification
 Classification algorithms are used when the output variable is
categorical, which means there may be two classes as in Yes-No,
Male-Female, True-false, spam or normal or morethan two classes.
 Some popular classification algorithms are; Random Forest, Decision
Trees, Logistic Regression, Support vector Machines.
2. Unsupervised learning:
11
 This type of machine learning involves algorithms that train on
unlabeled data. 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.
 In unsupervised learning, we don't have a predetermined result. The
machine tries to find useful insights from the huge amount of data.
Cont...
12

This type of machine learning are good for:


 Clustering: spliting the data sets into groups based on similarity.
 Association mining: identifying sets of items in a datasets that
frequently occur togethore.
 Dimensionality reduction: reducing the number of variables in a
dataset.
 And hence, it can be further classifieds into to Clustering and
Association algorithms.
Cont...
13
1. Clustering
 Clustering is a method of grouping the objects into clusters such that
objects with most similarities remains into a group and has less or no
similarities with the objects of another group. Cluster analysis finds
the commonalities between the data objects and categorizes them as
per the presence and absence of those commonalities.
2. Association
 An association rule is used for finding the relationships between
variables in the large database. It determines the set of items that
occurs together in the dataset. Association rule makes marketing
strategy more effective. Such as people who buy X item (suppose a
bread) are also tend to purchase Y (Butter/Jam) item.
3. Reinforcement Learning:
14

 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. 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.
AI Learning Models:

• AI learning models can be classified in two main types:

a.Inductive learning-
 Specific examples ----> general rule

b. deductive learning.
 General rule ----> Specific examples
Inductive learning
16

 The simplest type of learning: inductive learning.


 Simplest form: learn a function from examples.
 f is the target function.
 An example is a pair (x, f(x))
Inductive learning
17

 This can be very complex depending on the data. But, it is an


effective method used in ML and used in various areas like facial
recognition technology, disease cure, and diagnosis, etc.
 Problem: find a hypothesis h
such that h ≈ f (h is an approximation of f)
given a training set of examples
 This is a highly simplified model of real learning:
 Ignores prior knowledge.
 Assumes examples are given.

Examples: a. Apple is a fruit.


b. Apple tastes sweet.
Conclusion: All fruits taste sweet.
Deductive learning
18

 Unlike inductive learning, which is based on the


generalization of specific facts, deductive learning uses the
already available facts and information in order to give a
valid conclusion.
 Since, deductive reasoning works on pre-available logical facts,
let’s have a look.
Examples: a. All carnivores eat meat.
b. Lion is a carnivore.
Conclusion: – Lion eats meat.
Decision Tree
• A decision tree is a type of supervised learning algorithm that is
commonly used in machine learning to model and predict outcomes based
on input data.
• The input attributes can be discrete or continuous.
• We assume discrete attributes inputs, then the output value can be
discrete or continuous.
• Learning a discrete-valued function is called classification learning
• Learning a continuous function is called regression learning.
• We will concentrate on Boolean classification, where in each example is
classified as true (positive) or false (negative).
Decision Tree...

 A decision tree reaches its decision by performing a sequence of


tests.
 Each internal node in the tree is to test of the value of properties.
 The branches are labeled with the possible values of the test.
 Each leaf node specifies the value to be returned.
 A decision tree follows a set of if-else conditions to visualize the
data and classify it according to the conditions.
Decision Trees...
Learning decision trees
22

 This is one of the simplest and most successful of learning


algorithms.
 Problem: Suppose we arrive at a restaurant intending to
have dinner. If there is no space, depending on certain
circumstances we may decide whether to wait for a table at a
restaurant, based on the following attributes:
1. Alternate: is there an alternative restaurant nearby?
2. Bar: is there a comfortable bar area to wait in?
3. Fri/Sat: is today Friday or Saturday?
4. Hungry: are we hungry?
5. Patrons: number of people in the restaurant (None,
Some, Full)
6. Price: price range ($, $$, $$$)
7. Raining: is it raining outside?
8. Reservation: have we made a reservation?
9. Type: kind of restaurant (French, Italian, Thai, Burger)
Attribute-based representations
23

 Examples described by attribute values.


 E.g., situations where I will/won't wait for a table:
o (Decision to wait or not to wait a table at a restaurant)

Table– Training set for the restaurant learning problem


 Classification of example is either positive (T) or negative (F)
Decision trees
24
 One possible representation for hypotheses.
 E.g., here is the “true” tree for deciding whether to wait:
 Decision to wait or not to wait a table at a restaurant.

Figure – A decision tree for the restaurant problem


Decision Trees: Expressiveness
25


Decision trees can express any function of the input attributes.

E.g., for Boolean functions, truth table row → path to leaf:


Trivially, there is a consistent decision tree for any training set with one
path to leaf for each example but it probably won't generalize to new
examples.

Prefer to find more compact decision trees.
Hypothesis Space of Decision Trees
26

How many distinct decision trees with n Boolean attributes?


 With decision trees, if we have n attributes, there are 2 to the
power 2n different possible decision trees.
= number of Boolean functions
n
= number of distinct truth tables with 2n rows = 22

 E.g., with 6 Boolean attributes, there are


18,446,744,073,709,551,616 trees
Performance measurement
27
 How do we know that h ≈ f (h is an approximation of f) ?
1. Use theorems of computational/statistical learning theory.
2. Try h on a new test set of examples.
 Learning curve = % correct on test set as a function of
training set size.

Figure – A sample learning curve


Exercise:
28


Below is a training set for the problem of determining whether England will
win the football world cup. There are two input attributes (one Boolean and
one with three discrete values), and a Boolean outcome.
Using the information theory approach to selecting attributes, construct a
decision tree to represent this function.
INPUT ATTRIBUTES OUTPUT
RooneyPlays? Temperature? EnglandWin?
Yes 20-30oC Yes
Yes <20oC Yes
No <20oC No
No 20-30oC No
Yes >30oC No
No >30oC No
Exercise Solution
29
 Therefore the maximum information gain comes from choosing the
RooneyPlays attribute. We make this the root of the tree. Now we have the
following tree:

 We can see that the negative branch requires no further classification, as all
3 outcomes are Lose. The positive branch requires further classification, so
we use the Temperature attribute, resulting in the following final decision
tree:
Artificial Neural Networks
30

 Artificial Neural Networks is the subset of machine learning that


mimics the network of neurons in a brain.
 It works technically in the same way as machine learning does, but
with different capabilities and approaches.
 It is inspired by the functionality of human brain cells, which are
called neurons, and leads to the concept of artificial neural networks.
 ANNs are representations of human brain neurons within a computer.
 These sets of neurons form interconnected networks, but their
processes that trigger events and activations are quite different from
that of a real brain.
Cont...
31

 A neuron, taken individually, is relatively useless, but when


combined with hundreds or thousands of other neurons they form
an interconnected network that often outperforms any other
machine learning algorithm.
 In Neural network models use different layers to learn and discover
insights from the data.
The first layer is called the Input Layer.
The last layer is called the Output Layer.
All layers in between are called Hidden Layers.
Cont...
32
Cont...
33

 Each hidden layer is composed of neurons. The neurons are


connected to each other.
 The neuron will process and then propagate the input signal it receives
to the layer above it.
 The strength of the signal given the neuron in the next layer depends
on the weight, bias and activation function.
 The network consumes large amounts of input data and operates them
through multiple layers; the network can learn increasingly complex
features of the data at each layer.
Cont...
34
One useful distinction is that between feed-forward and recurrent
networks.
 In the feed-forward neural network such as CNN the information
flows only in forward direction, from the input layer through hidden
layer to the output layer. There are no cyle or loops in such a network.
Cont...
35

So there are a number of problems with this type of NN in that;
 Descissions are based on the current input.
 Cannot memorize previous input(no memory about the past).
 And hence as a solution for the problems of feed-forward neural
network, Recurrent NN has been proposed.
 Recurrent NN is typical neural network that works on the principle of
saving the output of a particular layer and feeding this back to the
input in order to predict the output of the layer.
 In simple words, it is an Artificial neural networks whose connections
between neurons include loops.
 That is, RNN have a “memory” which remembers all information
about what has been calculated and done before.
Cont...
36

In the feed-forward NN all the inputs and outputs are independent of
each other, but in cases like when it is required to predict the next
word of a sentence, the previous words are required and hence there is
a need to remember the previous words.

Thus, RNN is very usefull for such types of applications:
Output Layer
 Next word prediction,
 Speech Recognition,
 Machine Translation and etc..

Input Layer
Summary
37

 Learning needed for unknown environments, lazy designers.

 Learning agent = performance element + learning element.

 For supervised learning, the aim is to find a simple hypothesis


approximately consistent with training examples.
 Decision tree learning using information gain.

 Learning performance = prediction accuracy measured on test


set.
Any Question?

You might also like