Starting from:
$30

$24

ENGR Homework 01: Multivariate Parametric Classification Solution

In this homework, you will implement a multivariate parametric classification algorithm using

Python. Here are the steps you need to follow:

    1. Read Chapter 5 from the textbook.

    2. Generate random data points from three bivariate Gaussian densities with the following parameters:
!
+0.0
!
+3.2
+0.0
!
= 120

"
= #+2.5) ,

"
= #+0.0
+1.2) ,




−2.5


+1.2
+0.8
"
= 80

#
= #−2.0) ,

#
= #+0.8
+1.2) ,




+2.5


+1.2
−0.8
#
= 100


= #−2.0) ,


= #−0.8
+1.2) ,


Your data points should be like the following figure.























    3. Estimate the parameters   1!,   1",   1#, 2!, 2", 2#, 4(   = 1), 4(   = 2), and 4(   = 3) using the data points you generated in the previous step. Your parameter estimations should be like the following figures.


print(sample_means)


[[-0.06002769    2.37891762]

[-2.48316966 -2.07440702]


[ 2.566945    -1.97561107]]

print(sample_covariances)


[[[ 3.50095107    0.31087713]

[ 0.31087713    1.21501349]]


[[
1.19789275
0.64059315]
[
0.64059315
0.95264856]]


[[ 1.25199541 -0.79696973]


[-0.79696973    1.17191475]]]


print(class_priors)


[0.4, 0.26666666666666666, 0.3333333333333333]

    4. Calculate the confusion matrix for the data points in your training set using the parametric classification rule you will develop using the estimated parameters from the previous step. Your confusion matrix should be like the following matrix.

y_truth
1
2
3
y_pred



1
119
1
2
2
1
79
0

    3 0 098

        5. Draw your decision boundaries that you will calculate using the parametric classification rule from the previous step together with data points and clearly mark misclassified data points. Your figure should be like the following figure.

What to submit: You need to submit your source code in a single file (.py file) and a short report explaining your approach (.doc, .docx, or .pdf file). You will put these two files in a single zip file named as STUDENTID.zip, where STUDENTID should be replaced with your 7-digit student number.

How to submit: Submit the zip file you created to Blackboard. Please follow the exact style mentioned and do not send a zip file named as STUDENTID.zip. Submissions that do not follow these guidelines will not be graded.

Late submission policy: Late submissions will not be graded.

Cheating policy: Very similar submissions will not be graded.

More products