class_docstr: Hidden Markov Model with Gaussian mixture emissions.
  
  Attributes
  ----------
  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.
  
  weights_ : array, shape (n_components, n_mix)
      Mixture weights for each state.
  
  means_ : array, shape (n_components, n_mix, n_features)
      Mean parameters for each mixture component in each state.
  
  covars_ : array
      Covariance parameters for each mixture components in each state.
  
      The shape depends on :attr:`covariance_type`:
  
      * (n_components, n_mix)                          if "spherical",
      * (n_components, n_mix, n_features)              if "diag",
      * (n_components, n_mix, n_features, n_features)  if "full"
      * (n_components, n_features, n_features)         if "tied".
class_docstr_tok: ["Hidden","Markov","Model","with","Gaussian","mixture","emissions",".","Attributes","--","--","--","--","--","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",".","weights_",":","array",",","shape","(","n_components",",","n_mix",")","Mixture","weights","for","each","state",".","means_",":","array",",","shape","(","n_components",",","n_mix",",","n_features",")","Mean","parameters","for","each","mixture","component","in","each","state",".","covars_",":","array","Covariance","parameters","for","each","mixture","components","in","each","state",".","The","shape","depends","on",":","attr",":","`","covariance_type","`",":","*","(","n_components",",","n_mix",")","if","``","spherical","''",",","*","(","n_components",",","n_mix",",","n_features",")","if","``","diag","''",",","*","(","n_components",",","n_mix",",","n_features",",","n_features",")","if","``","full","''","*","(","n_components",",","n_features",",","n_features",")","if","``","tied","''","."]
docstr: Parameters
  ----------
  n_components : int
      Number of states in the model.
  
  n_mix : int
      Number of states in the GMM.
  
  covariance_type : {"sperical", "diag", "full", "tied"}, optional
      The type of covariance parameters to use:
  
      * "spherical" --- each state uses a single variance value that
        applies to all features.
      * "diag" --- each state uses a diagonal covariance matrix
        (default).
      * "full" --- each state uses a full (i.e. unrestricted)
        covariance matrix.
      * "tied" --- all mixture components of each state use **the same**
        full covariance matrix (note that this is not the same as for
        `GaussianHMM`).
  
  min_covar : float, optional
      Floor on the diagonal of the covariance matrix to prevent
      overfitting. Defaults to 1e-3.
  
  startprob_prior : array, shape (n_components, ), optional
      Parameters of the Dirichlet prior distribution for
      :attr:`startprob_`.
  
  transmat_prior : array, shape (n_components, n_components), optional
      Parameters of the Dirichlet prior distribution for each row
      of the transition probabilities :attr:`transmat_`.
  
  weights_prior : array, shape (n_mix, ), optional
      Parameters of the Dirichlet prior distribution for
      :attr:`weights_`.
  
  means_prior, means_weight : array, shape (n_mix, ), optional
      Mean and precision of the Normal prior distribtion for
      :attr:`means_`.
  
  covars_prior, covars_weight : array, shape (n_mix, ), optional
      Parameters of the prior distribution for the covariance matrix
      :attr:`covars_`.
  
      If :attr:`covariance_type` is "spherical" or "diag" the prior is
      the inverse gamma distribution, otherwise --- the inverse Wishart
      distribution.
  
  algorithm : {"viterbi", "map"}, optional
      Decoder algorithm.
  
      - "viterbi": finds the most likely sequence of states, given all
        emissions.
      - "map" (also known as smoothing or forward-backward): finds the
        sequence of the individual most-likely states, given all
        emissions.
  
  random_state: RandomState or an int seed, optional
      A random number generator instance.
  
  n_iter : int, optional
      Maximum number of iterations to perform.
  
  tol : float, optional
      Convergence threshold. EM will stop if the gain in log-likelihood
      is below this value.
  
  verbose : bool, optional
      Whether per-iteration convergence reports are printed to
      :data:`sys.stderr`.  Convergence can also be diagnosed using the
      :attr:`monitor_` attribute.
  
  params, init_params : string, optional
      The parameters that get updated during (``params``) or initialized
      before (``init_params``) the training.  Can contain any combination
      of 's' for startprob, 't' for transmat, 'm' for means, 'c'
      for covars, and 'w' for GMM mixing weights.  Defaults to all
      parameters.
  
  implementation : string, optional
      Determines if the forward-backward algorithm is implemented with
      logarithms ("log"), or using scaling ("scaling").  The default is
      to use logarithms for backwards compatability.
docstr_tok: ["Parameters","--","--","--","--","--","n_components",":","int","Number","of","states","in","the","model",".","n_mix",":","int","Number","of","states","in","the","GMM",".","covariance_type",":","{","``","sperical","''",",","``","diag","''",",","``","full","''",",","``","tied","''","}",",","optional","The","type","of","covariance","parameters","to","use",":","*","``","spherical","''","--","-","each","state","uses","a","single","variance","value","that","applies","to","all","features",".","*","``","diag","''","--","-","each","state","uses","a","diagonal","covariance","matrix","(","default",")",".","*","``","full","''","--","-","each","state","uses","a","full","(","i.e",".","unrestricted",")","covariance","matrix",".","*","``","tied","''","--","-","all","mixture","components","of","each","state","use","*","*","the","same","*","*","full","covariance","matrix","(","note","that","this","is","not","the","same","as","for","`","GaussianHMM","`",")",".","min_covar",":","float",",","optional","Floor","on","the","diagonal","of","the","covariance","matrix","to","prevent","overfitting",".","Defaults","to","1e-3",".","startprob_prior",":","array",",","shape","(","n_components",",",")",",","optional","Parameters","of","the","Dirichlet","prior","distribution","for",":","attr",":","`","startprob_","`",".","transmat_prior",":","array",",","shape","(","n_components",",","n_components",")",",","optional","Parameters","of","the","Dirichlet","prior","distribution","for","each","row","of","the","transition","probabilities",":","attr",":","`","transmat_","`",".","weights_prior",":","array",",","shape","(","n_mix",",",")",",","optional","Parameters","of","the","Dirichlet","prior","distribution","for",":","attr",":","`","weights_","`",".","means_prior",",","means_weight",":","array",",","shape","(","n_mix",",",")",",","optional","Mean","and","precision","of","the","Normal","prior","distribtion","for",":","attr",":","`","means_","`",".","covars_prior",",","covars_weight",":","array",",","shape","(","n_mix",",",")",",","optional","Parameters","of","the","prior","distribution","for","the","covariance","matrix",":","attr",":","`","covars_","`",".","If",":","attr",":","`","covariance_type","`","is","``","spherical","''","or","``","diag","''","the","prior","is","the","inverse","gamma","distribution",",","otherwise","--","-","the","inverse","Wishart","distribution",".","algorithm",":","{","``","viterbi","''",",","``","map","''","}",",","optional","Decoder","algorithm",".","-","``","viterbi","''",":","finds","the","most","likely","sequence","of","states",",","given","all","emissions",".","-","``","map","''","(","also","known","as","smoothing","or","forward-backward",")",":","finds","the","sequence","of","the","individual","most-likely","states",",","given","all","emissions",".","random_state",":","RandomState","or","an","int","seed",",","optional","A","random","number","generator","instance",".","n_iter",":","int",",","optional","Maximum","number","of","iterations","to","perform",".","tol",":","float",",","optional","Convergence","threshold",".","EM","will","stop","if","the","gain","in","log-likelihood","is","below","this","value",".","verbose",":","bool",",","optional","Whether","per-iteration","convergence","reports","are","printed","to",":","data",":","`","sys.stderr","`",".","Convergence","can","also","be","diagnosed","using","the",":","attr",":","`","monitor_","`","attribute",".","params",",","init_params",":","string",",","optional","The","parameters","that","get","updated","during","(","``","params","``",")","or","initialized","before","(","``","init_params","``",")","the","training",".","Can","contain","any","combination","of","'s","'","for","startprob",",","'t","'","for","transmat",",","'m","'","for","means",",","'","c'","for","covars",",","and","'","w","'","for","GMM","mixing","weights",".","Defaults","to","all","parameters",".","implementation",":","string",",","optional","Determines","if","the","forward-backward","algorithm","is","implemented","with","logarithms","(","``","log","''",")",",","or","using","scaling","(","``","scaling","''",")",".","The","default","is","to","use","logarithms","for","backwards","compatability","."]
code: def __init__(
      self,
      n_components=1,
      n_mix=1,
      min_covar=1e-3,
      startprob_prior=1.0,
      transmat_prior=1.0,
      weights_prior=1.0,
      means_prior=0.0,
      means_weight=0.0,
      covars_prior=None,
      covars_weight=None,
      algorithm="viterbi",
      covariance_type="diag",
      random_state=None,
      n_iter=10,
      tol=1e-2,
      verbose=False,
      params="stmcw",
      init_params="stmcw",
      implementation="log",
  ):
      """
      Parameters
      ----------
      n_components : int
          Number of states in the model.
  
      n_mix : int
          Number of states in the GMM.
  
      covariance_type : {"sperical", "diag", "full", "tied"}, optional
          The type of covariance parameters to use:
  
          * "spherical" --- each state uses a single variance value that
            applies to all features.
          * "diag" --- each state uses a diagonal covariance matrix
            (default).
          * "full" --- each state uses a full (i.e. unrestricted)
            covariance matrix.
          * "tied" --- all mixture components of each state use **the same**
            full covariance matrix (note that this is not the same as for
            `GaussianHMM`).
  
      min_covar : float, optional
          Floor on the diagonal of the covariance matrix to prevent
          overfitting. Defaults to 1e-3.
  
      startprob_prior : array, shape (n_components, ), optional
          Parameters of the Dirichlet prior distribution for
          :attr:`startprob_`.
  
      transmat_prior : array, shape (n_components, n_components), optional
          Parameters of the Dirichlet prior distribution for each row
          of the transition probabilities :attr:`transmat_`.
  
      weights_prior : array, shape (n_mix, ), optional
          Parameters of the Dirichlet prior distribution for
          :attr:`weights_`.
  
      means_prior, means_weight : array, shape (n_mix, ), optional
          Mean and precision of the Normal prior distribtion for
          :attr:`means_`.
  
      covars_prior, covars_weight : array, shape (n_mix, ), optional
          Parameters of the prior distribution for the covariance matrix
          :attr:`covars_`.
  
          If :attr:`covariance_type` is "spherical" or "diag" the prior is
          the inverse gamma distribution, otherwise --- the inverse Wishart
          distribution.
  
      algorithm : {"viterbi", "map"}, optional
          Decoder algorithm.
  
          - "viterbi": finds the most likely sequence of states, given all
            emissions.
          - "map" (also known as smoothing or forward-backward): finds the
            sequence of the individual most-likely states, given all
            emissions.
  
      random_state: RandomState or an int seed, optional
          A random number generator instance.
  
      n_iter : int, optional
          Maximum number of iterations to perform.
  
      tol : float, optional
          Convergence threshold. EM will stop if the gain in log-likelihood
          is below this value.
  
      verbose : bool, optional
          Whether per-iteration convergence reports are printed to
          :data:`sys.stderr`.  Convergence can also be diagnosed using the
          :attr:`monitor_` attribute.
  
      params, init_params : string, optional
          The parameters that get updated during (``params``) or initialized
          before (``init_params``) the training.  Can contain any combination
          of 's' for startprob, 't' for transmat, 'm' for means, 'c'
          for covars, and 'w' for GMM mixing weights.  Defaults to all
          parameters.
  
      implementation : string, optional
          Determines if the forward-backward algorithm is implemented with
          logarithms ("log"), or using scaling ("scaling").  The default is
          to use logarithms for backwards compatability.
      """
      BaseHMM.__init__(
          self,
          n_components,
          startprob_prior=startprob_prior,
          transmat_prior=transmat_prior,
          algorithm=algorithm,
          random_state=random_state,
          n_iter=n_iter,
          tol=tol,
          verbose=verbose,
          params=params,
          init_params=init_params,
          implementation=implementation,
      )
      self.covariance_type = covariance_type
      self.min_covar = min_covar
      self.n_mix = n_mix
      self.weights_prior = weights_prior
      self.means_prior = means_prior
      self.means_weight = means_weight
      self.covars_prior = covars_prior
      self.covars_weight = covars_weight
  
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 1 to create a new GMMHMM object from inherited base classes: _emissions with example: obj = GMMHMM(n_components, n_mix, min_covar, startprob_prior, transmat_prior, weights_prior, means_prior, means_weight, covars_prior, covars_weight, algorithm, covariance_type, random_state, n_iter, tol, verbose, params, init_params, implementation)