def _estimate_gaussian_covariance_full(resp, X, nk, means, reg_covar):
    n_features = X.shape[1]
    n_components = means.shape[0]
    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.
dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/mixture/gaussian_mixture.py/_estimate_gaussian_covariance_full