Em Algorithm, Statistics, Machine Learning, Clustering Algorithm, Python.
likelihood calculated by the current parameters """ for j in range(self.n_clusters): phi_j = self.phi[j] likelihood = multivariate_normal(self.means[j], self.cov[j]).pdf(X) self.w[:, j] = phi_j * likelihood log_likelihood = np.sum(np.log(np.sum(self.w, axis=1))) self.w = self.w / self.w.sum(axis=1,