23
PATTERN RECOGNITION Tutorial 2 Aly Osama 15-10-2016

Pattern recognition Tutorial 2

Embed Size (px)

Citation preview

PATTERN RECOGNITION

Tutorial 2Aly Osama

15-10-2016

Agenda

■ Rules and Attendance

■ Lab

– Lab Configuration

– Lab Tools

– Lab Experiment

■ Tutorial

– Solve Sheet 1 “ Problem 2 and 4”

■ 15 Minutes In Deep

– Estimating Probabilities

Pattern Recognition | Tutorial 2 | Aly Osama 2

1. Rules and Attendance

■ Tutorial Starts 11:00 - Ends 1:10

■ I will start at 11:05

■ Attendance at 11:08

■ Allowance Until 11:10

Pattern Recognition | Tutorial 2 | Aly Osama 3

2. Lab Configuration - Dataset

Pattern Recognition | Tutorial 2 | Aly Osama 4

Dataset

Feature 1 Feature 2 Feature 3 Feature 4 Class(Label)

2 1 3 7 1

3 2 1 2 2

41 1 44 2 1

61 3 1 5 1

14 51 5 9 2

X2X1 X3 X4 Y

2. Lab Configuration – Experiment

Pattern Recognition | Tutorial 2 | Aly Osama 5

Dataset

Training

Dataset

Testing

Dataset

75%

25%

Pattern

Recognition

Algorithm

Model

X(Feature Vector)

Calculate

Error

Y

(Real Class)

Accuracy

Y

(Predicted Class)

2. Lab Configuration – Algorithm

Pattern Recognition | Tutorial 2 | Aly Osama 6

Pattern

Recognition

Algorithm

As Example

Naive Bayes Classifier

Assign x to W2 if :

Given

• X: given data

• W1,W2 Two classes

2. Lab Configuration – Gaussian Bayes Classifier

Pattern Recognition | Tutorial 2 | Aly Osama 7

Unknown

• Mean of Data

• Standard Deviation

Loss Matrix Probability of Classes

Given

Ex: Gaussian

Unknown

Calculated from your dataset

2. Lab Configuration – Bayes Experiment

Pattern Recognition | Tutorial 2 | Aly Osama 8

Dataset

Training

Dataset

Testing

Dataset

75%

25%

Bayes Classifier

1. Probability

2. Expectation

3. Standard

Deviation

Model

X(Feature Vector)

Calculate

Error

Y

(Real Class)

Accuracy

Y

(Predicted Class)

2.2. Lab Tools

1. Select Dataset from UCI Machine Learning Repo

– https://archive.ics.uci.edu/ml/index.html

2. Install Matlab with PR Toolbox or Python with Scikit-learn

– PR Toolbox :

■ https://drive.google.com/drive/folders/0B9lOqlIVVRRIOF9VVFBtNHU4bEk?usp=drive_web

– Scikit Learn :

■ http://scikit-learn.org/

Pattern Recognition | Tutorial 2 | Aly Osama 9

We will tell you What to do

But you have to know How to do it

Pattern Recognition | Tutorial 2 | Aly Osama 10

Time to code!

2.3. Lab Experiment

Pattern Recognition | Tutorial 2 | Aly Osama 11

15 Minutes

Time to code!

3. Tutorial

Pattern Recognition | Tutorial 2 | Aly Osama 12

1 Hour

3. Tutorial – Problem 2

Pattern Recognition | Tutorial 2 | Aly Osama 13

3. Tutorial – Solution 2

Pattern Recognition | Tutorial 2 | Aly Osama 14

3. Tutorial – Solution 2

Pattern Recognition | Tutorial 2 | Aly Osama 15

3. Tutorial – Solution 2

Pattern Recognition | Tutorial 2 | Aly Osama 16

3. Tutorial – Problem 4

Pattern Recognition | Tutorial 2 | Aly Osama 17

3. Tutorial – Solution 4

Pattern Recognition | Tutorial 2 | Aly Osama 18

3. Tutorial – Solution 4

Pattern Recognition | Tutorial 2 | Aly Osama 19

4. 15 Minutes In Deep

Pattern Recognition | Tutorial 2 | Aly Osama 20

Estimating Probabilities

???

Tasks 3

1. Quick Presentation ( 2 Minutes )

2. Try to run different random/un random splits for ( Training and Testing ) datasets

1. 75%, 25%

2. 60%, 30%

3. 50%, 50 %

3. Perform Gaussian Bayes Classifier

4. Compare your results – Report -

Pattern Recognition | Tutorial 2 | Aly Osama 21

Due date 22-10-2016

References

■ Pattern Classification, 2nd Edition Duda & Hart

■ Machine Learning, Tom Mitchell: Estimating Probabilities

Pattern Recognition | Tutorial 2 | Aly Osama 22

Pattern Recognition | Tutorial 2 | Aly Osama 23

[email protected]