Starting from:
$30

$24

HW06: Expectation-Maximization Clustering Solution

In this homework, you will implement an expectation-maximization (EM) clustering algorithm in R, Matlab, or Python. Here are the steps you need to follow:




Generate random data points from five bivariate Gaussian densities with the following parameters:
"
+2.5
"
+0.8
−0.6
"
= 50


1
= $+2.5) ,
Σ
1
= $−0.6
+0.8) ,




= $
−2.5
Σ
= $
+0.8
+0.6
1
= 50
2
+2.5) ,
2
+0.6
+0.8) ,




= $
−2.5
Σ
= $
+0.8
−0.6
2
= 50
3
−2.5) ,
3
−0.6
+0.8) ,




= $
+2.5
Σ
= $
+0.8
+0.6
3
= 50
4
−2.5) ,
4
+0.6
+0.8) ,




= $
+0.0
Σ
= $
+1.6
+0.0
4
= 100


+0.0) ,


+0.0
+1.6) ,


Your data points should be similar to the following figure.









































































To initialize your EM algorithm from a good initial solution, run -means clustering algorithm with = 5 just for two iterations.






After running -means clustering algorithm for two iterations, take centroids as the initial values for the mean vectors in your EM algorithm. Using the data points covered by each center, estimate the initial covariance matrices and prior probabilities in your EM algorithm.
After the initialization step, run your EM algorithm for 100 iterations. Report the mean vectors your EM algorithm finds. Your results should be similar to the following matrix.



[,1] [,2]







[1,] -2.0441920 -2.69776844
[2,] 2.6622246 -2.30911081
[3,] 2.4887435 2.67687075
[4,] -2.6759195 2.44658904
[5,] 0.1553517 0.05773829



Draw the clustering result obtained by your EM algorithm by coloring each cluster with a different color. You should also draw the original Gaussian densities you use to generate data points and the Gaussian densities your EM algorithm finds with dashed and solid lines, respectively. Draw these Gaussian densities where their values are equal to 0.05. Your figure should be similar to the following figure.














































































What to submit: You need to submit your source code in a single file (.R file if you are using R,




.m file if you are using Matlab, or .py file if you are using Python) 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: E-mail the zip file you created to cak14@ku.edu.tr with the subject line Intro2MachineLearningHW06. Please follow the exact style mentioned for the subject line 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