class_docstr: Hidden Markov Model with Gaussian emissions.
  
  Attributes
  ----------
  n_features : int
      Dimensionality of the Gaussian emissions.
  
  monitor_ : ConvergenceMonitor
      Monitor object used to check the convergence of EM.
  
  startprob_ : array, shape (n_components, )
      Initial state occupation distribution.
  
  transmat_ : array, shape (n_components, n_components)
      Matrix of transition probabilities between states.
  
  means_ : array, shape (n_components, n_features)
      Mean parameters for each state.
  
  covars_ : array
      Covariance parameters for each state.
  
      The shape depends on :attr:`covariance_type`:
  
      * (n_components, )                        if "spherical",
      * (n_components, n_features)              if "diag",
      * (n_components, n_features, n_features)  if "full",
      * (n_features, n_features)                if "tied".
  
  Examples
  --------
  >>> from hmmlearn.hmm import GaussianHMM
  >>> GaussianHMM(n_components=2)  #doctest: +ELLIPSIS
  GaussianHMM(algorithm='viterbi',...
class_docstr_tok: ["Hidden","Markov","Model","with","Gaussian","emissions",".","Attributes","--","--","--","--","--","n_features",":","int","Dimensionality","of","the","Gaussian","emissions",".","monitor_",":","ConvergenceMonitor","Monitor","object","used","to","check","the","convergence","of","EM",".","startprob_",":","array",",","shape","(","n_components",",",")","Initial","state","occupation","distribution",".","transmat_",":","array",",","shape","(","n_components",",","n_components",")","Matrix","of","transition","probabilities","between","states",".","means_",":","array",",","shape","(","n_components",",","n_features",")","Mean","parameters","for","each","state",".","covars_",":","array","Covariance","parameters","for","each","state",".","The","shape","depends","on",":","attr",":","`","covariance_type","`",":","*","(","n_components",",",")","if","``","spherical","''",",","*","(","n_components",",","n_features",")","if","``","diag","''",",","*","(","n_components",",","n_features",",","n_features",")","if","``","full","''",",","*","(","n_features",",","n_features",")","if","``","tied","''",".","Examples","--","--","--","--",">",">",">","from","hmmlearn.hmm","import","GaussianHMM",">",">",">","GaussianHMM","(","n_components=2",")","#","doctest",":","+ELLIPSIS","GaussianHMM","(","algorithm='viterbi","'",",","..."]
code: def _do_mstep(self, stats):
      super()._do_mstep(stats)
  
      means_prior = self.means_prior
      means_weight = self.means_weight
  
      # TODO: find a proper reference for estimates for different
      #       covariance models.
      # Based on Huang, Acero, Hon, "Spoken Language Processing",
      # p. 443 - 445
      denom = stats["post"][:, None]
      if "m" in self.params:
          self.means_ = (means_weight * means_prior + stats["obs"]) / (
              means_weight + denom
          )
  
      if "c" in self.params:
          covars_prior = self.covars_prior
          covars_weight = self.covars_weight
          meandiff = self.means_ - means_prior
  
          if self.covariance_type in ("spherical", "diag"):
              c_n = (
                  means_weight * meandiff**2
                  + stats["obs**2"]
                  - 2 * self.means_ * stats["obs"]
                  + self.means_**2 * denom
              )
              c_d = max(covars_weight - 1, 0) + denom
              self._covars_ = (covars_prior + c_n) / np.maximum(
                  c_d, 1e-5
              )
              if self.covariance_type == "spherical":
                  self._covars_ = np.tile(
                      self._covars_.mean(1)[:, None],
                      (1, self._covars_.shape[1]),
                  )
          elif self.covariance_type in ("tied", "full"):
              c_n = np.empty(
                  (self.n_components, self.n_features, self.n_features)
              )
              for c in range(self.n_components):
                  obsmean = np.outer(stats["obs"][c], self.means_[c])
                  c_n[c] = (
                      means_weight * np.outer(meandiff[c], meandiff[c])
                      + stats["obs*obs.T"][c]
                      - obsmean
                      - obsmean.T
                      + np.outer(self.means_[c], self.means_[c])
                      * stats["post"][c]
                  )
              cvweight = max(covars_weight - self.n_features, 0)
              if self.covariance_type == "tied":
                  self._covars_ = (covars_prior + c_n.sum(axis=0)) / (
                      cvweight + stats["post"].sum()
                  )
              elif self.covariance_type == "full":
                  self._covars_ = (covars_prior + c_n) / (
                      cvweight + stats["post"][:, None, None]
                  )
  
imports: import logging
  import numpy
  from scipy import linalg
  from sklearn import cluster
  from sklearn.utils import check_random_state
  from .None import _emissions, _utils
  from .base import BaseHMM
  from .utils import fill_covars, normalize
label_desc: Use image node_id 8 for calling the GaussianHMM obj's underlying member method code with example usage: obj._do_mstep(stats) without return types