Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please solve (c) thx a lot!!! Data used in Problems 1 and 2 X1 train and X2train are training data points in Class 1 and
Please solve (c) thx a lot!!!
Data used in Problems 1 and 2 X1 train 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] In particular, show the steps in your computation of the following items: i. S1,S2,Sw,SB,w,Y1,Y2 in Step 1 . ii. 1,1,2,2 in Step 2. iii. The classification threshold obtained in Step 3. (Hint: Make use of the results obtained in the tutorial). (b) (20 marks) Write a Python function called LDA to verify your calculation in Part (a). The function should have a header: def LDA (X1, X2) where X1 and X2 are arranged in columns. In the function, codes should be written to (1) compute Item i, ii and iii in Part (a), (2) plot of all the data points with the projection vector w superimposed and (3) f(yCk) for k=1,2 and (4) f(Cky) for k=1,2. The script should be submitted as an individual file named LDA.py and the codes written in the script should be copied and pasted to your report. Page 2 of 3 (c) (10 marks) Write scripts in a cell of the Jupyter Notebook file named Problem2 . ipynb. In this script, you should: i. Train the model using the LDA function written in Part (b) using the training data. The value of each of Items i, ii and iii listed in Part (a) should be made to display on the command window. These values should be copied and pasted to the report. All the plots generated in Python should be included in the report. ii. Classify the test data points into Class 1 and 2Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered 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