class_docstr: Gaussian Mixture.
  
  Representation of a Gaussian mixture model probability distribution.
  This class allows to estimate the parameters of a Gaussian mixture
  distribution.
  
  .. versionadded:: 0.18
  *GaussianMixture*.
  
  Read more in the :ref:`User Guide <gmm>`.
  
  Parameters
  ----------
  n_components : int, defaults to 1.
      The number of mixture components.
  
  covariance_type : {'full', 'tied', 'diag', 'spherical'},
          defaults to 'full'.
      String describing the type of covariance parameters to use.
      Must be one of::
  
          'full' (each component has its own general covariance matrix),
          'tied' (all components share the same general covariance matrix),
          'diag' (each component has its own diagonal covariance matrix),
          'spherical' (each component has its own single variance).
  
  tol : float, defaults to 1e-3.
      The convergence threshold. EM iterations will stop when the
      lower bound average gain is below this threshold.
  
  reg_covar : float, defaults to 0.
      Non-negative regularization added to the diagonal of covariance.
      Allows to assure that the covariance matrices are all positive.
  
  max_iter : int, defaults to 100.
      The number of EM iterations to perform.
  
  n_init : int, defaults to 1.
      The number of initializations to perform. The best results are kept.
  
  init_params : {'kmeans', 'random'}, defaults to 'kmeans'.
      The method used to initialize the weights, the means and the
      precisions.
      Must be one of::
  
          'kmeans' : responsibilities are initialized using kmeans.
          'random' : responsibilities are initialized randomly.
  
  weights_init : array-like, shape (n_components, ), optional
      The user-provided initial weights, defaults to None.
      If it None, weights are initialized using the `init_params` method.
  
  means_init: array-like, shape (n_components, n_features), optional
      The user-provided initial means, defaults to None,
      If it None, means are initialized using the `init_params` method.
  
  precisions_init: array-like, optional.
      The user-provided initial precisions (inverse of the covariance
      matrices), defaults to None.
      If it None, precisions are initialized using the 'init_params' method.
      The shape depends on 'covariance_type'::
  
          (n_components,)                        if 'spherical',
          (n_features, n_features)               if 'tied',
          (n_components, n_features)             if 'diag',
          (n_components, n_features, n_features) if 'full'
  
  random_state : RandomState or an int seed, defaults to None.
      A random number generator instance.
  
  warm_start : bool, default to False.
      If 'warm_start' is True, the solution of the last fitting is used as
      initialization for the next call of fit(). This can speed up
      convergence when fit is called several time on similar problems.
  
  verbose : int, default to 0.
      Enable verbose output. If 1 then it prints the current
      initialization and each iteration step. If greater than 1 then
      it prints also the log probability and the time needed
      for each step.
  
  verbose_interval : int, default to 10.
      Number of iteration done before the next print.
  
  Attributes
  ----------
  weights_ : array-like, shape (n_components,)
      The weights of each mixture components.
  
  means_ : array-like, shape (n_components, n_features)
      The mean of each mixture component.
  
  covariances_ : array-like
      The covariance of each mixture component.
      The shape depends on `covariance_type`::
  
          (n_components,)                        if 'spherical',
          (n_features, n_features)               if 'tied',
          (n_components, n_features)             if 'diag',
          (n_components, n_features, n_features) if 'full'
  
  precisions_ : array-like
      The precision matrices for each component in the mixture. A precision
      matrix is the inverse of a covariance matrix. A covariance matrix is
      symmetric positive definite so the mixture of Gaussian can be
      equivalently parameterized by the precision matrices. Storing the
      precision matrices instead of the covariance matrices makes it more
      efficient to compute the log-likelihood of new samples at test time.
      The shape depends on `covariance_type`::
  
          (n_components,)                        if 'spherical',
          (n_features, n_features)               if 'tied',
          (n_components, n_features)             if 'diag',
          (n_components, n_features, n_features) if 'full'
  
  precisions_cholesky_ : array-like
      The cholesky decomposition of the precision matrices of each mixture
      component. A precision matrix is the inverse of a covariance matrix.
      A covariance matrix is symmetric positive definite so the mixture of
      Gaussian can be equivalently parameterized by the precision matrices.
      Storing the precision matrices instead of the covariance matrices makes
      it more efficient to compute the log-likelihood of new samples at test
      time. The shape depends on `covariance_type`::
  
          (n_components,)                        if 'spherical',
          (n_features, n_features)               if 'tied',
          (n_components, n_features)             if 'diag',
          (n_components, n_features, n_features) if 'full'
  
  converged_ : bool
      True when convergence was reached in fit(), False otherwise.
  
  n_iter_ : int
      Number of step used by the best fit of EM to reach the convergence.
  
  lower_bound_ : float
      Log-likelihood of the best fit of EM.
  
  See Also
  --------
  BayesianGaussianMixture : Gaussian mixture model fit with a variational
      inference.
docstr: Initialization of the Gaussian mixture parameters.
  
  Parameters
  ----------
  X : array-like, shape (n_samples, n_features)
  
  resp : array-like, shape (n_samples, n_components)
docstr_tok: ["Initialization","of","the","Gaussian","mixture","parameters",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","(","n_samples",",","n_features",")","resp",":","array-like",",","shape","(","n_samples",",","n_components",")"]
code: def _initialize(self, X, resp):
      """Initialization of the Gaussian mixture parameters.
  
      Parameters
      ----------
      X : array-like, shape (n_samples, n_features)
  
      resp : array-like, shape (n_samples, n_components)
      """
      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
  
imports: import numpy
  from scipy import linalg
  from .base import BaseMixture, _check_shape
  from ..externals.six.moves import zip
  from ..utils import check_array
  from ..utils.validation import check_is_fitted
  from ..utils.extmath import row_norms
label_desc: Use image node_id 3 for calling the GaussianMixture obj's underlying member method code with example usage: obj._initialize(X, resp) without return types