def _estimate_gaussian_parameters(X, resp, reg_covar, covariance_type):
 nk = (resp.sum(axis=0) + (10 * np.finfo(resp.dtype).eps))
 means = (np.dot(resp.T, X) / nk[:, np.newaxis])
 covariances = {'full': _estimate_gaussian_covariances_full, 'tied': _estimate_gaussian_covariances_tied, 'diag': _estimate_gaussian_covariances_diag, 'spherical': _estimate_gaussian_covariances_spherical}[covariance_type](resp, X, nk, means, reg_covar)
 return (nk, means, covariances)

def _estimate_gaussian_parameters ( X , resp , reg_covar , covariance_type ) : nk = ( resp . sum ( axis = 0 ) + ( 10 * np . finfo ( resp . dtype ) . eps ) ) means = ( np . dot ( resp . T , X ) / nk [ : , np . newaxis ] ) covariances = { 'full' : _estimate_gaussian_covariances_full , 'tied' : _estimate_gaussian_covariances_tied , 'diag' : _estimate_gaussian_covariances_diag , 'spherical' : _estimate_gaussian_covariances_spherical } [ covariance_type ] ( resp , X , nk , means , reg_covar ) return ( nk , means , covariances )
estimate the gaussian distribution parameters .