Em Algorithm, Statistics, Machine Learning, Clustering Algorithm, Python.
Given data Returns ------- """ # phi : (n_clusters,) phi = self.w.sum(axis=0) # update phi self.phi = phi / X.shape[0] # update mean self.means = np.dot(self.w.T, X) / phi.reshape(-1, 1) # update covariance for j in range(self.n_clusters): diff = (X - self.means[j]).T self.cov[j] = np.dot(self.w[:,