Starting from:

$29.99

ENGR 421 / DASC 521 Homework 7-Expectation-maximization (EM) clustering Solution


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

1. You are given a two-dimensional data set in the file named hw07_data_set.csv, which contains 300 data points generated randomly from five bivariate Gaussian densities with the following parameters.

𝜇! = #++22..55( , Σ! = #+−00..86 −0.6( ,
+0.8 𝑁! = 50
𝜇" = #−+22..55( , Σ" = #++00..86 +0.6( ,
+0.8 𝑁" = 50
𝜇# = #−−22..55( , Σ# = #+−00..86 −0.6( ,
+0.8 𝑁# = 50
𝜇$ = #+−22..55( , Σ$ = #++00..86 +0.6( ,
+0.8 𝑁$ = 50
𝜇% = #++00..00( , Σ% = #++10..60 +0.0( ,
+1.6 𝑁% = 100

The given data points are shown in the following figure.

2. To initialize your EM algorithm, you should take the centroids given in the file named hw07_initial_centroids.csv as the initial values for the mean vectors. By assigning the data points to the nearest center, estimate the initial covariance matrices and prior probabilities in your EM algorithm.

3. 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.

[[-2.44390052 -2.5453942 ]
[ 2.50354332 2.51134859]
[ 2.56726404 -2.55477253]
[ 0.12794677 0.15595776]
[-2.41465305 2.4855615 ]]

4. 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 (.py file) and a short report explaining your approach (.doc, .docx, or .pdf file).
How to submit: Submit the two files (source code and short report) you created to Blackboard. Submissions that do not follow these guidelines will not be graded.
Cheating policy: Very similar submissions will not be graded.

More products