Question: You will be tasked with implementing a K - means clustering and a Gaussian mixture model using Gibbs sampling. For the case of the Gaussian
You will be tasked with implementing a Kmeans clustering and a Gaussian mixture model using Gibbs sampling. For the case of
the Gaussian mixture model, suppose our data generating process is:
You may fix the value of the hyperpriors Note that the likelihood for is a multivariate Gaussian distribution.
Derive the posterior updates for the parameters For deriving the full conditional of two properties that may be
useful are the properties of the conditional distribution of a mv Gaussian and completing the square of a matrix.
Compare the Gibbs sampling algorithm using the posterior updates you wrote in Question with the KMeans algorithm.
Under what conditions is the KMeans algorithm a special case of the Gibbs sampler for a GMM
Now, implement the Gibbs sampler for the GMM and the KMeans algorithm. Test to see if your implementation works
correctly by fitting the model by generating some synthetic data. You may use the function 'sklearn.datasets.makeblobs' with
the default setting to test this. One quantitative way to measure the performance per iteration to track the progress of your
model is to calculate the loglikelihood of the data per iteration. If it improves on average, then you may be in the right direction
this is not mandatory, but it should help during the debugging process
Fit the data to the 'sklearn.datasets.loaddigits' handwritten data set. It may be helpful to rescale the data to have zero mean
and unit variance. Try to plot the cluster centers, comment on the performance.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
