def _estimate_gaussian_covariances_full(resp, X, nk, means, reg_covar):
 (n_components, n_features) = means.shape
 covariances = np.empty((n_components, n_features, n_features))
 for k in range(n_components):
  diff = (X - means[k])
  covariances[k] = (np.dot((resp[:, k] * diff.T), diff) / nk[k])
  covariances[k].flat[::(n_features + 1)] += reg_covar
 return covariances

def _estimate_gaussian_covariances_full ( resp , X , nk , means , reg_covar ) : ( n_components , n_features ) = means . shape covariances = np . empty ( ( n_components , n_features , n_features ) ) for k in range ( n_components ) : diff = ( X - means [ k ] ) covariances [ k ] = ( np . dot ( ( resp [ : , k ] * diff . T ) , diff ) / nk [ k ] ) covariances [ k ] . flat [ : : ( n_features + 1 ) ] += reg_covar return covariances
estimate the full covariance matrices .