Deliverables for this assignment:
- Programming Assignment (MATLAB or Python)
- Code file and output screenshots for all. You can make use of built in command to find the covariance matrix, where normalization is done using 1/ n-1.
Q1. Find and plot the decision boundary between class Ο1 and Ο2. Assume P(Ο1) = P(Ο2).
Ο1 = [1,6; 3,4; 3,8; 5,6]
Ο2 = [3,0; 1,-2;3,-4;5,-2]
Q2. Find and plot the decision boundary between class Ο1 and Ο2. Assume P(Ο1) =0.3; P(Ο2)=0.7
Ο1 = [1,-1; 2,-5; 3,-6; 4,-10; 5,-12; 6,-15]
Ο2 = [-1,1; -2,5; -3,6; -4,10, -5,12; -6, 15]
Q3. Find and plot the decision boundary between class Ο1 and Ο2. Assume P(Ο1) = P(Ο2).
Ο1 = [2,6; 3,4; 3,8; 4,6]
Ο2 = [3,0; 1,-2; 3,-4; 5,-2]
Q4. Implement Bayes Classifier for Iris Dataset.
Dataset Specifications:
Total number of samples = 150
Number of classes = 3 (Iris setosa, Iris virginica, and Iris versicolor) Number of samples in each class = 50
Use the following information to design classifier:
Number of training feature vectors ( first 40 in each class)Β = 40
Number of test feature vectors ( remaining 10 in each class) = 10
Number of dimensions = 4
Feature vector = <sepal length, sepal width, petal length, petal width>
If the samples follow a multivariate normal density, find the accuracy of classification for the test feature vectors.
Q5. Use only two features: Petal Length and Petal Width, for 3 class classification and draw the decision boundary between them (2 dimension, 3 regions also called as multi-class problem)
Q6. Consider the 128- dimensional feature vectors given in the βface feature vectors.csvβ file. Use this information to design and implement a Bayes Classifier.
Dataset Specifications:
Total number of samples = 800
Number of classes = 2 ( labelled as βmaleβ and βfemaleβ)
Samples from β1 to 400βΒ belongs to class βmaleβ
Samples from β401 to 800β belongs to class βfemaleβ
Number of samples per class = 400
Use the following information to design classifier:
Number of test feature vectors ( first 5 in each class)Β = 5
Number of training feature vectors ( remaining 395 in each class) = 395Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Number of dimensions = 128
Design of Bayes Classifier
Given,
Iris dataset
π =< π₯1 , π₯2, π₯3, π₯4 >
Number of classes= π1, π2, π3 ;Β c=3
N=150; n(π1)=n(π1)=n(π1)=50 Bayes Rule:
Find π(ππ|π) = π(π|ππ(ππ)).π(ππ)
π(π) is a constant for all classes; so it can be ignored.
Steps to follow in Iris Classification:
- Find apriori probability π(ππ) = π(πππ) =
- Find π(π|ππ), Β itβs multivariate class, by following normal density
π(π|ππ) = Β (2π)π/21 |π΄π|1/2 ππ₯π [β Β {(π β Β΅π)π‘π΄πβ1(π β Β΅π)}]
2 a. Find the mean vector
2 b. Find the covariance matrix, π΄π
2 c. Find the |π΄π| and |π΄π|β1
- Find π(π1|π), π(π2|π) πππ π(π3|π). Β Find the maximum and assign π to that class. Also, plot the accuracy for :Β Β Β Β Β Β Β Β i) Separate classesΒ Β Β Β Β ii) Overall performance
- Find the discriminant function and draw the decision surface between the classes.
Note: The same steps can be followed for Q6.
******************************************************************************



