Gaussian Mixture Model (GMM) M-step
Clustering DS practice problem on Onlearn.
Difficulty: medium.
Topics: Gaussian Mixture Model (GMM) M-step, Responsibility Weights, Covariance Matrix Update, Log-Likelihood Convergence, Cluster Centroid Re-estimation, Mixing Coefficient Normalization, Probability Theory, Statistical Inference, Numerical Optimization, Linear Algebra, Unsupervised Learning, Expectation-Maximization Algorithm, Multivariate Normal Distributions, Latent Variable Modeling, Maximum Likelihood Estimation, Iterative Parameter Refinement.
Implement the Maximization step (M step) of the Expectation Maximization (EM) algorithm for Gaussian Mixture Models. Given data points X and responsibilities (posterior probabilities) gamma computed from the E step, update the GMM parameters: means, covariances, and mixing coefficients. The M step finds the parameters that maximize the expected log likelihood given the current responsibilities. Your function should: 1. Accept data points X of shape (N, D) where N is the number of samples and D is the dimensionality 2. Accept responsibilities gamma of shape (N, K) where K is the number of mixture components 3. Return updated means of shape (K, D), covariances of shape (K, D, D), and mixing coefficients of shape (K,) 4. Handle both numpy arrays and Python lists as inputs