Answered step by step
Verified Expert Solution
Question
1 Approved Answer
DO PART B only Data used in Problems 1 and 2 X1train and X2train are training data points in Class 1 and 2, respectively. Xtest
DO PART B only
Data used in Problems 1 and 2 X1train and X2train are training data points in Class 1 and 2, respectively. Xtest are testing data points to be classified into Class 1 and 2 . In the following expression, two-dimensional data points are represented in columns: X1train=[23324432545328460065]X2train=[716915101311119171313914111511141012]Xtest=[40102.51012.5] Problem 1 (a) (20 marks) Use the Gaussian Discriminant Analysis method to come up with a mathematical description of the decision boundary used to classify Class 1 and 2 . Use the training data to train the model and determine the decision boundary. Then classify each of the test points based on the posterior probabilities f(C1x) and f(C2x). In your submission, show the steps in your computation of the following items. Note that all calculations in Part (a) should be done by hand: i. : The prior probability of Class 1 ; ii. 1,2 : The mean vectors of the two classes; iii. S1,S2,S : The covariance matrices of the two classes and the mean covariance matrix; iv. w and w0 in the decision boundary equation: wTx+w0=0. b) (20 marks) Write a Python function called GaussianDiscriminantAnalysis to verify your calculation in Part (a). The function header should have the following form: def Gaussiandiscriminantanalysis (X1, X2) where data points in X1 and X2 are arranged in columns. In the function, codes should be written to (1) compute Item i, ii, iii and iv in Part (a) and the decision boundary and (2) plot of all the training data points with the decision boundary superimposed. You are encouraged to use the matlabplotlib.pyplot library for plotting. The function should be saved as an individual file named GaussiandiscriminantAnalysis.py and the codes written to implement the function should be copied and pasted to your reportStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started