def _estimate_log_gaussian_prob_diag(X, means, covariances):
    if np.any(np.less_equal(covariances, 0.0)):
        raise ValueError("The algorithm has diverged because of too "
                         "few samples per components. "
                         "Try to decrease the number of components, or "
                         "increase reg_covar.")
    n_samples, n_features = X.shape
    log_prob = - .5 * (n_features * np.log(2. * np.pi) +
                       np.sum(np.log(covariances), 1) +
                       np.sum((means ** 2 / covariances), 1) -
                       2. * np.dot(X, (means / covariances).T) +
                       np.dot(X ** 2, (1. / covariances).T))
    return log_prob
Estimate the log Gaussian probability for 'diag' covariance.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/mixture/gaussian_mixture.py/_estimate_log_gaussian_prob_diag