SlideShare a Scribd company logo
Islamic University of Technology (IUT)
LAB#01
Designing a Minimum
Distance to Class Mean
Classifier
Mamunur Rashid (104420)
Date of Submission: 6/13/2014
1 | P a g e
Table of Contents
Introduction ..................................................................................................................................................2
Task ...............................................................................................................................................................2
Solution.........................................................................................................................................................3
Step1 (Plotting two-class set of prototypes) ............................................................................................3
Step 2 (Calculating the distance from the calculated mean of each class using Linear Discriminant
Function)...................................................................................................................................................3
Step 3 (Drawing the decision boundary between the two-classes) .........................................................4
Matlab Code..................................................................................................................................................5
Conclusion:....................................................................................................................................................7
2 | P a g e
Introduction
“Minimum Distance to Class Mean Classifier” is used to classify unclassified sample vectors
where the vectors clustered in more than one classes are given. For example, in a dataset
containing n sample vectors of dimension d some given sample vectors are already clustered
into classes and some are not. We can classify the unclassified sample vectors with Class Mean
Classifier.
Task
Given the following two-class set of prototypes
w1 = {(2, 2), (3, 1), (3, 3), (-1,-3), (4, 2), (-2, -2)}
w2 = {(0, 0), (-2, 2), (-1,-1), (-4, 2), (-4, 3), (2, 6)}
1. Plot all sample points from both classes, but samples from the same class should have the
same color and marker.
2. Using a minimum distance classifier with respect to ‘class mean’, classify the following points
by plotting them with the designated class-color but different marker.
X1 = (-1,-1)
X2 = (3, 2)
X3 = (-2, 1)
X4 = (8, 2)
Linear Discriminant Function:
3. Draw the decision boundary between the two-classes.
3 | P a g e
Solution
Step1 (Plotting two-class set of prototypes)
Two classes were given. Firstly we plotted all the points. Samples from the same class were
plotted using the same color and marker so that different classes can be distinguished easily.
Here green solids represent class 1 and blue solids represent class 2.Figure of the corresponding
result:
Step 2 (Calculating the distance from the calculated mean of each class using Linear
Discriminant Function)
Now for each of the point (X1…X4) we calculated the distance from the calculated mean of each
class using Linear Discriminant Function.
4 | P a g e
The point was assigned to a class with minimum distance from the respected class mean. For
better visualization, we used the same class color but different marker while plotting those
points. Here the triangular shapes are the given training samples. Class 1 and class 2 are green
and blue colored respectively.
Step 3 (Drawing the decision boundary between the two-classes)
Decision boundary between the two classes is to be drawn now. For finding out this boundary
we considered all possible points within the range considering those points as over the
boundary line whose distance from both the classes is same. However as the distance may not
be exactly the same, we used a threshold value to draw the approximate boundary between
the two classes. Here straight line created by red circles with blue dots represents the straight
line boundary between the two classes.
5 | P a g e
Matlab Code
% Given two-class set of prototypes
w1 = [2 2; 3 1; 3 3; -1 -3; 4 2; -2 -2];
w2 = [0 0; -2 2; -1 -1; -4 2; -4 3; 2 6];
% Plot all sample points from both classes,
% samples from the same class should have the same color and marker
plot(w1(:,1),w1(:,2),'s','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g');
hold on;
6 | P a g e
plot(w2(:,1),w2(:,2),'s','LineWidth',2,...
'MarkerEdgeColor','m',...
'MarkerFaceColor','b');
legend('class 1','class 2');
legend off;
% Calculating means of class 1 and 2
% and then assign them in y1 and y2 respectively
y1 = [ mean(w1(:,1)) mean(w1(:,2))];
y2 = [ mean(w2(:,1)) mean(w2(:,2))];
% Unclassified Samples
x = [-1 -1; 3 2; -2 1; 8 2];
% For n number of samples, calculate Linear Discriminant Function
for n = 1:4
g1 = x(n,:) * y1' - .5 * (y1 * y1');
g2 = x(n,:) * y2' - .5 * (y2 * y2');
7 | P a g e
if g1 > g2
plot(x(n,1),x(n,2),'v','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','g');
else
plot(x(n,1),x(n,2),'v','LineWidth',2,...
'MarkerEdgeColor','m',...
'MarkerFaceColor','b');
end
end
% Calculate decision boundary between two classes
d = [-4:2:8];
d = [d' 2 .* d' + 1.25];
plot(d(:,1),d(:,2),'--o','LineWidth',2,...
'MarkerEdgeColor','k',...
'MarkerFaceColor','r');
legend('decision boundary');
hold off;
Conclusion:
This algorithm is very easy to implement and apply. As it conducts simple calculations, its’
calculation is apparently faster. The weakness of the algorithm is its misclassification rate is also
relatively higher because the boundary between the two classes is linear.

More Related Content

What's hot

Lecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsLecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest Neighbors
Marina Santini
 
Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...
Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...
Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...
Marina Santini
 
A Comprehensive Overview of Clustering Algorithms in Pattern Recognition
A Comprehensive Overview of Clustering Algorithms in Pattern  RecognitionA Comprehensive Overview of Clustering Algorithms in Pattern  Recognition
A Comprehensive Overview of Clustering Algorithms in Pattern Recognition
IOSR Journals
 
Nov 02 P2
Nov 02 P2Nov 02 P2
Nov 02 P2
Samimvez
 
Smu bsc it sem 1 fall 2014 solved assignments
Smu bsc it sem  1 fall 2014 solved assignmentsSmu bsc it sem  1 fall 2014 solved assignments
Smu bsc it sem 1 fall 2014 solved assignments
smumbahelp
 
Deep Learning through Pytorch Exercises
Deep Learning through Pytorch ExercisesDeep Learning through Pytorch Exercises
Deep Learning through Pytorch Exercises
aiaioo
 
K nearest neighbor
K nearest neighborK nearest neighbor
K nearest neighbor
Ujjawal
 
BAS 250 Lecture 8
BAS 250 Lecture 8BAS 250 Lecture 8
BAS 250 Lecture 8
Wake Tech BAS
 
Machine Learning Basics
Machine Learning BasicsMachine Learning Basics
Machine Learning Basics
Humberto Marchezi
 
Bca1040 digital logic
Bca1040   digital logicBca1040   digital logic
Bca1040 digital logic
smumbahelp
 
Lecture slides week14-15
Lecture slides week14-15Lecture slides week14-15
Lecture slides week14-15
Shani729
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clustering
Farah M. Altufaili
 
Bsc it summer 2015 solved assignments
Bsc it summer   2015 solved assignmentsBsc it summer   2015 solved assignments
Bsc it summer 2015 solved assignments
smumbahelp
 
Understandig PCA and LDA
Understandig PCA and LDAUnderstandig PCA and LDA
Understandig PCA and LDA
Dr. Syed Hassan Amin
 
Nearest Class Mean Metric Learning
Nearest Class Mean Metric LearningNearest Class Mean Metric Learning
Nearest Class Mean Metric Learning
Sangjun Han
 
wzhu_paper
wzhu_paperwzhu_paper
wzhu_paper
Wenzhen Zhu
 
2.8 accuracy and ensemble methods
2.8 accuracy and ensemble methods2.8 accuracy and ensemble methods
2.8 accuracy and ensemble methods
Krish_ver2
 
8. Vectors data frames
8. Vectors data frames8. Vectors data frames
8. Vectors data frames
ExternalEvents
 
Getting Started with Machine Learning
Getting Started with Machine LearningGetting Started with Machine Learning
Getting Started with Machine Learning
Humberto Marchezi
 
Dimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLabDimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLab
CloudxLab
 

What's hot (20)

Lecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest NeighborsLecture 8: Decision Trees & k-Nearest Neighbors
Lecture 8: Decision Trees & k-Nearest Neighbors
 
Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...
Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...
Lecture 02: Machine Learning for Language Technology - Decision Trees and Nea...
 
A Comprehensive Overview of Clustering Algorithms in Pattern Recognition
A Comprehensive Overview of Clustering Algorithms in Pattern  RecognitionA Comprehensive Overview of Clustering Algorithms in Pattern  Recognition
A Comprehensive Overview of Clustering Algorithms in Pattern Recognition
 
Nov 02 P2
Nov 02 P2Nov 02 P2
Nov 02 P2
 
Smu bsc it sem 1 fall 2014 solved assignments
Smu bsc it sem  1 fall 2014 solved assignmentsSmu bsc it sem  1 fall 2014 solved assignments
Smu bsc it sem 1 fall 2014 solved assignments
 
Deep Learning through Pytorch Exercises
Deep Learning through Pytorch ExercisesDeep Learning through Pytorch Exercises
Deep Learning through Pytorch Exercises
 
K nearest neighbor
K nearest neighborK nearest neighbor
K nearest neighbor
 
BAS 250 Lecture 8
BAS 250 Lecture 8BAS 250 Lecture 8
BAS 250 Lecture 8
 
Machine Learning Basics
Machine Learning BasicsMachine Learning Basics
Machine Learning Basics
 
Bca1040 digital logic
Bca1040   digital logicBca1040   digital logic
Bca1040 digital logic
 
Lecture slides week14-15
Lecture slides week14-15Lecture slides week14-15
Lecture slides week14-15
 
Fuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clusteringFuzzy image processing- fuzzy C-mean clustering
Fuzzy image processing- fuzzy C-mean clustering
 
Bsc it summer 2015 solved assignments
Bsc it summer   2015 solved assignmentsBsc it summer   2015 solved assignments
Bsc it summer 2015 solved assignments
 
Understandig PCA and LDA
Understandig PCA and LDAUnderstandig PCA and LDA
Understandig PCA and LDA
 
Nearest Class Mean Metric Learning
Nearest Class Mean Metric LearningNearest Class Mean Metric Learning
Nearest Class Mean Metric Learning
 
wzhu_paper
wzhu_paperwzhu_paper
wzhu_paper
 
2.8 accuracy and ensemble methods
2.8 accuracy and ensemble methods2.8 accuracy and ensemble methods
2.8 accuracy and ensemble methods
 
8. Vectors data frames
8. Vectors data frames8. Vectors data frames
8. Vectors data frames
 
Getting Started with Machine Learning
Getting Started with Machine LearningGetting Started with Machine Learning
Getting Started with Machine Learning
 
Dimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLabDimensionality Reduction | Machine Learning | CloudxLab
Dimensionality Reduction | Machine Learning | CloudxLab
 

Viewers also liked

Designing A Minimum Distance to Class Mean Classifier
Designing A Minimum Distance to Class Mean ClassifierDesigning A Minimum Distance to Class Mean Classifier
Designing A Minimum Distance to Class Mean Classifier
Md. Toufique Hasan
 
Introduction to pattern recognition
Introduction to pattern recognitionIntroduction to pattern recognition
Introduction to pattern recognition
Luís Gustavo Martins
 
Object Recognition: Fourier Descriptors and Minimum-Distance Classification
Object Recognition: Fourier Descriptors and Minimum-Distance ClassificationObject Recognition: Fourier Descriptors and Minimum-Distance Classification
Object Recognition: Fourier Descriptors and Minimum-Distance Classification
Cody Ray
 
International Journal of Image Processing and Pattern Recognition vol 2 issue 1
International Journal of Image Processing and Pattern Recognition vol 2 issue 1International Journal of Image Processing and Pattern Recognition vol 2 issue 1
International Journal of Image Processing and Pattern Recognition vol 2 issue 1
JournalsPub www.journalspub.com
 
nural network ER. Abhishek k. upadhyay
nural network ER. Abhishek  k. upadhyaynural network ER. Abhishek  k. upadhyay
nural network ER. Abhishek k. upadhyay
abhishek upadhyay
 
Application of image processing
Application of image processingApplication of image processing
Application of image processing
University of Potsdam
 
Caricaturas y series populares
Caricaturas y series popularesCaricaturas y series populares
Caricaturas y series populares
claudimandy
 
25 november 2012
25 november 201225 november 2012
25 november 2012
Al-Quds
 
Story Pallets
Story PalletsStory Pallets
Story Pallets
HistoryFactory
 
Aqsanews47
Aqsanews47Aqsanews47
Aqsanews47
Al-Quds
 
Nl 35 jan08
Nl 35 jan08Nl 35 jan08
Nl 35 jan08
Al-Quds
 
Exhibit Design
Exhibit DesignExhibit Design
Exhibit Design
HistoryFactory
 
Issue39 complete 4web
Issue39 complete 4webIssue39 complete 4web
Issue39 complete 4web
Al-Quds
 
Corporate Anniversaries
Corporate AnniversariesCorporate Anniversaries
Corporate Anniversaries
HistoryFactory
 
Newspaper issue 40
Newspaper issue 40Newspaper issue 40
Newspaper issue 40
Al-Quds
 
Penza presentation eng
Penza presentation engPenza presentation eng
Penza presentation eng
Валерий Миронов
 
Thefacts 100602180839-phpapp02
Thefacts 100602180839-phpapp02Thefacts 100602180839-phpapp02
Thefacts 100602180839-phpapp02
Al-Quds
 
Random 100603202106-phpapp01
Random 100603202106-phpapp01Random 100603202106-phpapp01
Random 100603202106-phpapp01Al-Quds
 
Aqsanews43
Aqsanews43Aqsanews43
Aqsanews43
Al-Quds
 
Thefacts 1273799630-phpapp01
Thefacts 1273799630-phpapp01Thefacts 1273799630-phpapp01
Thefacts 1273799630-phpapp01
Al-Quds
 

Viewers also liked (20)

Designing A Minimum Distance to Class Mean Classifier
Designing A Minimum Distance to Class Mean ClassifierDesigning A Minimum Distance to Class Mean Classifier
Designing A Minimum Distance to Class Mean Classifier
 
Introduction to pattern recognition
Introduction to pattern recognitionIntroduction to pattern recognition
Introduction to pattern recognition
 
Object Recognition: Fourier Descriptors and Minimum-Distance Classification
Object Recognition: Fourier Descriptors and Minimum-Distance ClassificationObject Recognition: Fourier Descriptors and Minimum-Distance Classification
Object Recognition: Fourier Descriptors and Minimum-Distance Classification
 
International Journal of Image Processing and Pattern Recognition vol 2 issue 1
International Journal of Image Processing and Pattern Recognition vol 2 issue 1International Journal of Image Processing and Pattern Recognition vol 2 issue 1
International Journal of Image Processing and Pattern Recognition vol 2 issue 1
 
nural network ER. Abhishek k. upadhyay
nural network ER. Abhishek  k. upadhyaynural network ER. Abhishek  k. upadhyay
nural network ER. Abhishek k. upadhyay
 
Application of image processing
Application of image processingApplication of image processing
Application of image processing
 
Caricaturas y series populares
Caricaturas y series popularesCaricaturas y series populares
Caricaturas y series populares
 
25 november 2012
25 november 201225 november 2012
25 november 2012
 
Story Pallets
Story PalletsStory Pallets
Story Pallets
 
Aqsanews47
Aqsanews47Aqsanews47
Aqsanews47
 
Nl 35 jan08
Nl 35 jan08Nl 35 jan08
Nl 35 jan08
 
Exhibit Design
Exhibit DesignExhibit Design
Exhibit Design
 
Issue39 complete 4web
Issue39 complete 4webIssue39 complete 4web
Issue39 complete 4web
 
Corporate Anniversaries
Corporate AnniversariesCorporate Anniversaries
Corporate Anniversaries
 
Newspaper issue 40
Newspaper issue 40Newspaper issue 40
Newspaper issue 40
 
Penza presentation eng
Penza presentation engPenza presentation eng
Penza presentation eng
 
Thefacts 100602180839-phpapp02
Thefacts 100602180839-phpapp02Thefacts 100602180839-phpapp02
Thefacts 100602180839-phpapp02
 
Random 100603202106-phpapp01
Random 100603202106-phpapp01Random 100603202106-phpapp01
Random 100603202106-phpapp01
 
Aqsanews43
Aqsanews43Aqsanews43
Aqsanews43
 
Thefacts 1273799630-phpapp01
Thefacts 1273799630-phpapp01Thefacts 1273799630-phpapp01
Thefacts 1273799630-phpapp01
 

Similar to Pattern Recognition: Class mean classifier

Taller parcial 2
Taller parcial 2Taller parcial 2
Taller parcial 2
RubenAlfredoTomalaVe
 
Lda
LdaLda
Feature Selection
Feature Selection Feature Selection
Feature Selection
Lippo Group Digital
 
Statistics firstfive
Statistics firstfiveStatistics firstfive
Statistics firstfive
Sukirti Garg
 
Image classification using neural network
Image classification using neural networkImage classification using neural network
Image classification using neural network
Bhavyateja Potineni
 
Implementing Minimum Error Rate Classifier
Implementing Minimum Error Rate ClassifierImplementing Minimum Error Rate Classifier
Implementing Minimum Error Rate Classifier
Dipesh Shome
 
Linear vs. quadratic classifier power point
Linear vs. quadratic classifier power pointLinear vs. quadratic classifier power point
Linear vs. quadratic classifier power point
Alaa Tharwat
 
The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)
The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)
The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)
Universitat Politècnica de Catalunya
 
Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...
Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...
Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...
ERIKAMARIAGUDIOSANTA
 
Learning multifractal structure in large networks (Purdue ML Seminar)
Learning multifractal structure in large networks (Purdue ML Seminar)Learning multifractal structure in large networks (Purdue ML Seminar)
Learning multifractal structure in large networks (Purdue ML Seminar)
Austin Benson
 
Machine hw3
Machine hw3Machine hw3
Machine hw3
Yi Cui
 
Algorithmic Mathematics.
Algorithmic Mathematics.Algorithmic Mathematics.
Algorithmic Mathematics.
Dr. Volkan OBAN
 
Wordoku Puzzle Solver - Image Processing Project
Wordoku Puzzle Solver - Image Processing ProjectWordoku Puzzle Solver - Image Processing Project
Wordoku Puzzle Solver - Image Processing Project
Surya Chandra
 
RDataMining slides-clustering-with-r
RDataMining slides-clustering-with-rRDataMining slides-clustering-with-r
RDataMining slides-clustering-with-r
Yanchang Zhao
 
[PPT]
[PPT][PPT]
[PPT]
butest
 
Math1
Math1Math1
Math1
Anil Kumar
 
Implementation of K-Nearest Neighbor Algorithm
Implementation of K-Nearest Neighbor AlgorithmImplementation of K-Nearest Neighbor Algorithm
Implementation of K-Nearest Neighbor Algorithm
Dipesh Shome
 
Cluster analysis using k-means method in R
Cluster analysis using k-means method in RCluster analysis using k-means method in R
Cluster analysis using k-means method in R
Vladimir Bakhrushin
 
An analysis between exact and approximate algorithms for the k-center proble...
An analysis between exact and approximate algorithms for the  k-center proble...An analysis between exact and approximate algorithms for the  k-center proble...
An analysis between exact and approximate algorithms for the k-center proble...
IJECEIAES
 
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
ArchiLab 7
 

Similar to Pattern Recognition: Class mean classifier (20)

Taller parcial 2
Taller parcial 2Taller parcial 2
Taller parcial 2
 
Lda
LdaLda
Lda
 
Feature Selection
Feature Selection Feature Selection
Feature Selection
 
Statistics firstfive
Statistics firstfiveStatistics firstfive
Statistics firstfive
 
Image classification using neural network
Image classification using neural networkImage classification using neural network
Image classification using neural network
 
Implementing Minimum Error Rate Classifier
Implementing Minimum Error Rate ClassifierImplementing Minimum Error Rate Classifier
Implementing Minimum Error Rate Classifier
 
Linear vs. quadratic classifier power point
Linear vs. quadratic classifier power pointLinear vs. quadratic classifier power point
Linear vs. quadratic classifier power point
 
The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)
The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)
The Perceptron (DLAI D1L2 2017 UPC Deep Learning for Artificial Intelligence)
 
Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...
Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...
Aplicaciones de espacios y subespacios vectoriales en la carrera de tecnologi...
 
Learning multifractal structure in large networks (Purdue ML Seminar)
Learning multifractal structure in large networks (Purdue ML Seminar)Learning multifractal structure in large networks (Purdue ML Seminar)
Learning multifractal structure in large networks (Purdue ML Seminar)
 
Machine hw3
Machine hw3Machine hw3
Machine hw3
 
Algorithmic Mathematics.
Algorithmic Mathematics.Algorithmic Mathematics.
Algorithmic Mathematics.
 
Wordoku Puzzle Solver - Image Processing Project
Wordoku Puzzle Solver - Image Processing ProjectWordoku Puzzle Solver - Image Processing Project
Wordoku Puzzle Solver - Image Processing Project
 
RDataMining slides-clustering-with-r
RDataMining slides-clustering-with-rRDataMining slides-clustering-with-r
RDataMining slides-clustering-with-r
 
[PPT]
[PPT][PPT]
[PPT]
 
Math1
Math1Math1
Math1
 
Implementation of K-Nearest Neighbor Algorithm
Implementation of K-Nearest Neighbor AlgorithmImplementation of K-Nearest Neighbor Algorithm
Implementation of K-Nearest Neighbor Algorithm
 
Cluster analysis using k-means method in R
Cluster analysis using k-means method in RCluster analysis using k-means method in R
Cluster analysis using k-means method in R
 
An analysis between exact and approximate algorithms for the k-center proble...
An analysis between exact and approximate algorithms for the  k-center proble...An analysis between exact and approximate algorithms for the  k-center proble...
An analysis between exact and approximate algorithms for the k-center proble...
 
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
Fessant aknin oukhellou_midenet_2001:comparison_of_supervised_self_organizing...
 

Recently uploaded

RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Diana Rendina
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Fajar Baskoro
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
siemaillard
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
paigestewart1632
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
HajraNaeem15
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
S. Raj Kumar
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 

Recently uploaded (20)

RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
 
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
Reimagining Your Library Space: How to Increase the Vibes in Your Library No ...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Pengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptxPengantar Penggunaan Flutter - Dart programming language1.pptx
Pengantar Penggunaan Flutter - Dart programming language1.pptx
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptxPrésentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
Présentationvvvvvvvvvvvvvvvvvvvvvvvvvvvv2.pptx
 
Cognitive Development Adolescence Psychology
Cognitive Development Adolescence PsychologyCognitive Development Adolescence Psychology
Cognitive Development Adolescence Psychology
 
How to deliver Powerpoint Presentations.pptx
How to deliver Powerpoint  Presentations.pptxHow to deliver Powerpoint  Presentations.pptx
How to deliver Powerpoint Presentations.pptx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching AptitudeUGC NET Exam Paper 1- Unit 1:Teaching Aptitude
UGC NET Exam Paper 1- Unit 1:Teaching Aptitude
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 

Pattern Recognition: Class mean classifier

  • 1. Islamic University of Technology (IUT) LAB#01 Designing a Minimum Distance to Class Mean Classifier Mamunur Rashid (104420) Date of Submission: 6/13/2014
  • 2. 1 | P a g e Table of Contents Introduction ..................................................................................................................................................2 Task ...............................................................................................................................................................2 Solution.........................................................................................................................................................3 Step1 (Plotting two-class set of prototypes) ............................................................................................3 Step 2 (Calculating the distance from the calculated mean of each class using Linear Discriminant Function)...................................................................................................................................................3 Step 3 (Drawing the decision boundary between the two-classes) .........................................................4 Matlab Code..................................................................................................................................................5 Conclusion:....................................................................................................................................................7
  • 3. 2 | P a g e Introduction “Minimum Distance to Class Mean Classifier” is used to classify unclassified sample vectors where the vectors clustered in more than one classes are given. For example, in a dataset containing n sample vectors of dimension d some given sample vectors are already clustered into classes and some are not. We can classify the unclassified sample vectors with Class Mean Classifier. Task Given the following two-class set of prototypes w1 = {(2, 2), (3, 1), (3, 3), (-1,-3), (4, 2), (-2, -2)} w2 = {(0, 0), (-2, 2), (-1,-1), (-4, 2), (-4, 3), (2, 6)} 1. Plot all sample points from both classes, but samples from the same class should have the same color and marker. 2. Using a minimum distance classifier with respect to ‘class mean’, classify the following points by plotting them with the designated class-color but different marker. X1 = (-1,-1) X2 = (3, 2) X3 = (-2, 1) X4 = (8, 2) Linear Discriminant Function: 3. Draw the decision boundary between the two-classes.
  • 4. 3 | P a g e Solution Step1 (Plotting two-class set of prototypes) Two classes were given. Firstly we plotted all the points. Samples from the same class were plotted using the same color and marker so that different classes can be distinguished easily. Here green solids represent class 1 and blue solids represent class 2.Figure of the corresponding result: Step 2 (Calculating the distance from the calculated mean of each class using Linear Discriminant Function) Now for each of the point (X1…X4) we calculated the distance from the calculated mean of each class using Linear Discriminant Function.
  • 5. 4 | P a g e The point was assigned to a class with minimum distance from the respected class mean. For better visualization, we used the same class color but different marker while plotting those points. Here the triangular shapes are the given training samples. Class 1 and class 2 are green and blue colored respectively. Step 3 (Drawing the decision boundary between the two-classes) Decision boundary between the two classes is to be drawn now. For finding out this boundary we considered all possible points within the range considering those points as over the boundary line whose distance from both the classes is same. However as the distance may not be exactly the same, we used a threshold value to draw the approximate boundary between the two classes. Here straight line created by red circles with blue dots represents the straight line boundary between the two classes.
  • 6. 5 | P a g e Matlab Code % Given two-class set of prototypes w1 = [2 2; 3 1; 3 3; -1 -3; 4 2; -2 -2]; w2 = [0 0; -2 2; -1 -1; -4 2; -4 3; 2 6]; % Plot all sample points from both classes, % samples from the same class should have the same color and marker plot(w1(:,1),w1(:,2),'s','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','g'); hold on;
  • 7. 6 | P a g e plot(w2(:,1),w2(:,2),'s','LineWidth',2,... 'MarkerEdgeColor','m',... 'MarkerFaceColor','b'); legend('class 1','class 2'); legend off; % Calculating means of class 1 and 2 % and then assign them in y1 and y2 respectively y1 = [ mean(w1(:,1)) mean(w1(:,2))]; y2 = [ mean(w2(:,1)) mean(w2(:,2))]; % Unclassified Samples x = [-1 -1; 3 2; -2 1; 8 2]; % For n number of samples, calculate Linear Discriminant Function for n = 1:4 g1 = x(n,:) * y1' - .5 * (y1 * y1'); g2 = x(n,:) * y2' - .5 * (y2 * y2');
  • 8. 7 | P a g e if g1 > g2 plot(x(n,1),x(n,2),'v','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','g'); else plot(x(n,1),x(n,2),'v','LineWidth',2,... 'MarkerEdgeColor','m',... 'MarkerFaceColor','b'); end end % Calculate decision boundary between two classes d = [-4:2:8]; d = [d' 2 .* d' + 1.25]; plot(d(:,1),d(:,2),'--o','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','r'); legend('decision boundary'); hold off; Conclusion: This algorithm is very easy to implement and apply. As it conducts simple calculations, its’ calculation is apparently faster. The weakness of the algorithm is its misclassification rate is also relatively higher because the boundary between the two classes is linear.