def _step_E(self, points):
"""
In this step the algorithm evaluates the responsibilities of each points in each cluster
Parameters
----------
points : an array (n_points,dim)
Returns
-------
log_resp: an array (n_points,n_components)
an array containing the logarithm of the responsibilities.
log_prob_norm : an array (n_points,)
logarithm of the probability of each sample in points
"""
log_normal_matrix = _log_normal_matrix(points,self.means,self.cov,self.covariance_type,self.n_jobs)
log_product = log_normal_matrix + self.log_weights[:,np.newaxis].T
log_prob_norm = logsumexp(log_product,axis=1)
log_resp = log_product - log_prob_norm[:,np.newaxis]
return log_prob_norm,log_resp
评论列表
文章目录