'Initialization of the Gaussian mixture parameters.
Parameters
X : array-like, shape (n_samples, n_features)
resp : array-like, shape (n_samples, n_components)'

def _initialize(self, X, resp):

    (n_samples, _) = X.shape
    (weights, means, covariances) = _estimate_gaussian_parameters(X, resp, self.reg_covar, self.covariance_type)
    weights /= n_samples
    self.weights_ = (weights if (self.weights_init is None) else self.weights_init)
    self.means_ = (means if (self.means_init is None) else self.means_init)
    if (self.precisions_init is None):
        self.covariances_ = covariances
        self.precisions_cholesky_ = _compute_precision_cholesky(covariances, self.covariance_type)
    elif (self.covariance_type == 'full'):
        self.precisions_cholesky_ = np.array([linalg.cholesky(prec_init, lower=True) for prec_init in self.precisions_init])
    elif (self.covariance_type == 'tied'):
        self.precisions_cholesky_ = linalg.cholesky(self.precisions_init, lower=True)
    else:
        self.precisions_cholesky_ = self.precisions_init
