Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

Artificial Intelligence

(ITec4151)

Chapter 4-
Learning

Complied by Wasyihun S.(MSc.) 2014


1
Contents
• What is learning

• Types of learning

• Learning approaches/methods

• Construct Model/Prototype

Complied by Wasyihun S.
(MSc.) 2014 2
Introduction
• One of the most important characteristics of human
beings is their capacity to learn as a human
intelligence .
• Our personality, our habits, skills, knowledge, attitude
and interest is largely the result of learning.
• These are important in helping the individual to adapt
to his environment.

Complied by Wasyihun S.
(MSc.) 2014 3
What learning is?

Learning is:
• Memorizing something

• Knowing facts through observation and exploration

• Improving motor and/or cognitive skills through practice

• Learning: it is training (adaptation) from data set

Complied by Wasyihun S.
(MSc.) 2014 4
Cont….
The idea behind learning is that percepts should not
only be used for acting now, but also for improving the
agent’s ability to act in the future.
– Learning is essential for unknown environments, i.e. when
the agent lacks knowledge.
– Learning modifies the agent's decision making mechanisms to
improve performance

Complied by Wasyihun S.
(MSc.) 2014 5
Types of Learning.
1. Supervised learning: occurs where a set of input/output
pairs are explicitly presented to the agent by a
learner.
• Is the learning process when the outcome variable is
known.
• The outcome datasets are used to train the machine and
get
the desired output.
– The learner provides a category label for each pattern
in a
training set, then the learning algorithm finds a rule that
Complied by Wasyihun S.
does a good job of predicting the output associated with6 a
(MSc.) 2014
An example: data (loan application)

Complied by Wasyihun S.
(MSc.) 2014 7
The Learning Process
• Learn a classification model from the data
• Use the model to classify future loan applications
into
– Yes (approved) and
– No (not approved)
• What is the class for following case/instance?

Complied by Wasyihun S.
(MSc.) 2014 8
applications

Complied by Wasyihun S.
(MSc.) 2014 9
2. Unsupervised learning: Learning when there is
no information about what the correct outputs
 The class labels of training data is unknown.
are.
- A form of learning by observation rather than
learning by examples
- Clustering is a technique for finding similarity groups
in data.

Complied by Wasyihun S.
(MSc.) 2014 10
Cont…
• Thus Cluster Analysis
– Finding groups of objects such that the objects in a
group will be similar (or related) to one another and
different from (or unrelated to) the objects in
other groups
Inter-cluster
Intra-cluster distances
distances are are
minimized maximized

Complied by Wasyihun S.
(MSc.) 2014 11
3.Reinforcement Learning (RL): an agent interacting
with the world makes observations, takes actions, & is
rewarded or punished; it should learn to choose actions in
order to obtain a lot of reward.
– The agent is given an evaluation of its action, but not told the correct
action.
– If the responses is successful in action and satisfied
the needs, on the subsequent occasions the individual
will tend to repeat it.
More general than supervised/unsupervised learning
learn from interaction w/ environment to achieve a
goal. Complied by Wasyihun S.
(MSc.) 2014

2014 12
Data sets preparation for learning
• Training set
–Used in supervised learning, a training set is a set of
problem instances (described as a set of properties and their
values), together with a classification of the instance.
• Test set
– A set of instances used to test the accuracy of a learned
hypothesis.
– Training sets is used to build model and test sets is used to
determine the accuracy of the model.
– The test set is used to see how well it works for
classifying future or unknown objects

Complied by by
Complied Berhanu A. S.
Wasyihun
(MSc.) (MSc.)
20142014 13
How to Split Dataset into Training and Testing Sets?
 Holdout Method
– Given data is randomly partitioned into
two independent sets
o Training set (2/3) for model construction
o Test set (1/3) for accuracy estimation
- If many (thousands) of examples are available, including several
hundred examples from each class.
 Cross-Validation Method
-Randomly partition the data into k mutually exclusive
subsets, each approximately equal size.
-Where k = 10 is most popular.

- Complied by Wasyihun S.
(MSc.) 2014 14
• Learning—A Two-Step Process
• Model construction:
– A training set is used to create the model.
– The model is represented as classification rules
or mathematical formulae.
• Model usage:
– The test set is used to see how well it works
for classifying future or unknown objects

Complied by Wasyihun S.
(MSc.) 2014 15
Step 1: Model Construction

Classification
Algorithms
Trainin
g
Data

N A M E RANK Y EARS T E N U R E D Classifier


M ike Assistant Prof 3 no (Model)
M ary Assistant Prof 7 yes
Bill Professor 2 yes
Jim Associate Prof 7 yes
IF rank = ‘professor’
Dave Assistant Prof 6 no
Anne Associate Prof 3 no
OR years > 6
Complied by Wasyihun S. THEN tenured = ‘yes’
(MSc.) 2014 16
Step 2: Using the Model in Prediction

Classifier
model

Testin
g Unseen Data
Data
(Jeff, Professor, 4)
N A M E R ANK YEARS TENURED
Tom Assistant Prof 2 no Tenured?
M erlisa Associate Prof 7 no
G eorge Professor 5 yes
Joseph Assistant Prof Complied by Wasyihun
7lied byBerhanu yAe.(sS.
Comp MSc.) 17
(MSc.)
20142014
Metrics for Performance Evaluation…
PREDICTED CLASS
Class=Yes Class=No
Class=Yes a b
(TP) (FN)
ACTUA
L Class=No c d
CLASS (FP) (TN)

• Most widely-used metric:


– To measure the performance of the model in general:
ad TP
Accuracy  *100
 a  b  c  d TP 
FP

Complied by by
Complied Berhanu A. S.
Wasyihun
(MSc.) (MSc.)
20142014 18
Confusion Matrix
• A confusion matrix is useful tool for analyzing how well your
classifier can recognize tuples of different classes

• A confusion matrix displays the number of correct and incorrect


predictions made by the model compared with the actual
classifications in the test data.

Observe the following Confusion Matrix


Predicate Class
Classified as Cancer Not Cancer
Actual
Class Cancer 7(# of TP) 2(# of FN) Tot al Dataset=14

Not Cancer 3(# of FP) 2(# of TN)


• The matrix is n-by-n, where n is the number of classes.

• The above confusion matrix can be used to calculate TP, FP,


Precision, Recall and FC-oMmpeeia dsWasyihun
buy rBeer, a n d(. aScls). o Accuracy of
Compliedl by S.han u A M
the system (MSc.)
20142014 19
Performance Measure

Table-1 Confusion Matrix


for a 2-class problem

Complied by by
Complied Berhanu A. S.
Wasyihun
(MSc.) (MSc.)
20142014 20
Classifier performance Measure Examples
Compute the following performance measures from the
confusion matrix given below.
Classes Yes NO
- Sensitivity, Specificity, Accuracy, Recall and Precision

Yes 90 210
NO 140 9560
Accuracy =(TP + TN)/(P+N) = 9650/10,000 = 96.50%
Error Rate= 1-Accuracy= 1- 0.965= 3.5%
Precision = TP/(TP+FP) = TP/N = 90/230 = 39.13%
Recall = TP/TP+FN= TP/P =90/90+210= 30%

Complied by Wasyihun S.(MSc.) 2014


2014 21
Performance Measure
 Accuracy
- classifier accuracy: predicting class label
- predictor accuracy: guessing value of predicted attributes
 Speed
-time to construct the model (training time)
-time to use the model (classification/prediction time)
 Robustness: handling noise and missing values

 Scalability: efficiency in disk-resident databases

 Interpretability
- understanding and insight provided by the model
Complied by Wasyihun S.
(MSc.) 2014 22
Purpose of Evaluation
• The objective of learning classifications from sample
data is to classify and predict successfully on new data

• The aim of evaluation is to estimate the true error rate


using a finite amount of data.

• The true error rate is defined as the error rate of a


classifier on an asymptotically large number of new
cases that converge in the limit to the actual population
distribution (i.e. it is an inherently statistical measure).

Complied by Wasyihun S.
(MSc.) 2014 23
Home work
1. What is learning? List types of learning?

2. Discuss the learning agent Components?

3. What are the two classification tasks and discus it.

4. What is the purpose of confusion matrix?

5. What are the commonly used measures for


evaluating the classification(Classifier model)
performance

6. Which factors affect the performance of


Complied by Wasyihun S.
24
classifier model? (MSc.) 2014
Learning methods
• There are various learning methods.
Popular learning techniques include the
following.
– Neural networks:
– Decision tree :
– Bayesian network: a probabilistic model
– Regression
– Support vector machine

Complied by Wasyihun S.
(MSc.) 2014 25
Reading Assignment
• Deep Learning
• How the human brain works?
• How Neural network works??????
• What is Back Propagation Algorithm?
ANN?
• Describe the algorithm?
• How does it work?

Complied by Wasyihun S.
(MSc.) 2014 26
Thank you

Complied by Wasyihun S.
(MSc.) 2014 27

You might also like