class_docstr: A wrapper for a zero-inflated distribution.
  
  Some discrete distributions, e.g. Poisson or negative binomial, are used
  to model data that has many more zeroes in it than one would expect from
  the true signal itself. Potentially, this is because data collection devices
  fail or other gaps exist in the data. A zero-inflated distribution is
  essentially a mixture of these zero values and the real underlying
  distribution.
  
  Accordingly, this class serves as a wrapper that can be dropped in for
  other probability distributions and makes them "zero-inflated". It is
  similar to a mixture model between the distribution passed in and a dirac
  delta distribution, except that the mixture happens independently for each
  distribution as well as for each example.
  
  
  Parameters
  ----------
  distribution: pomegranate.distributions.Distribution
          A pomegranate distribution object. It should probably be a discrete
          distribution, but does not technically have to be.
  
  priors: tuple, numpy.ndarray, torch.Tensor, or None. shape=(2,), optional
          The prior probabilities over the given distribution and the dirac
          delta component. Default is None.
  
  max_iter: int, optional
          The number of iterations to do in the EM step of fitting the
          distribution. Default is 10.
  
  tol: float, optional
          The threshold at which to stop during fitting when the improvement
          goes under. Default is 0.1.
  
  inertia: float, [0, 1], optional
          Indicates the proportion of the update to apply to the parameters
          during training. When the inertia is 0.0, the update is applied in
          its entirety and the previous parameters are ignored. When the
          inertia is 1.0, the update is entirely ignored and the previous
          parameters are kept, equivalently to if the parameters were frozen.
  
  frozen: bool, optional
          Whether all the parameters associated with this distribution are frozen.
          If you want to freeze individual pameters, or individual values in those
          parameters, you must modify the `frozen` attribute of the tensor or
          parameter directly. Default is False.
  
  verbose: bool, optional
          Whether to print the improvement and timings during training.
class_docstr_tok: ["A","wrapper","for","a","zero-inflated","distribution",".","Some","discrete","distributions",",","e.g",".","Poisson","or","negative","binomial",",","are","used","to","model","data","that","has","many","more","zeroes","in","it","than","one","would","expect","from","the","true","signal","itself",".","Potentially",",","this","is","because","data","collection","devices","fail","or","other","gaps","exist","in","the","data",".","A","zero-inflated","distribution","is","essentially","a","mixture","of","these","zero","values","and","the","real","underlying","distribution",".","Accordingly",",","this","class","serves","as","a","wrapper","that","can","be","dropped","in","for","other","probability","distributions","and","makes","them","``","zero-inflated","''",".","It","is","similar","to","a","mixture","model","between","the","distribution","passed","in","and","a","dirac","delta","distribution",",","except","that","the","mixture","happens","independently","for","each","distribution","as","well","as","for","each","example",".","Parameters","--","--","--","--","--","distribution",":","pomegranate.distributions.Distribution","A","pomegranate","distribution","object",".","It","should","probably","be","a","discrete","distribution",",","but","does","not","technically","have","to","be",".","priors",":","tuple",",","numpy.ndarray",",","torch.Tensor",",","or","None",".","shape=","(","2",",",")",",","optional","The","prior","probabilities","over","the","given","distribution","and","the","dirac","delta","component",".","Default","is","None",".","max_iter",":","int",",","optional","The","number","of","iterations","to","do","in","the","EM","step","of","fitting","the","distribution",".","Default","is","10.","tol",":","float",",","optional","The","threshold","at","which","to","stop","during","fitting","when","the","improvement","goes","under",".","Default","is","0.1.","inertia",":","float",",","[","0",",","1","]",",","optional","Indicates","the","proportion","of","the","update","to","apply","to","the","parameters","during","training",".","When","the","inertia","is","0.0",",","the","update","is","applied","in","its","entirety","and","the","previous","parameters","are","ignored",".","When","the","inertia","is","1.0",",","the","update","is","entirely","ignored","and","the","previous","parameters","are","kept",",","equivalently","to","if","the","parameters","were","frozen",".","frozen",":","bool",",","optional","Whether","all","the","parameters","associated","with","this","distribution","are","frozen",".","If","you","want","to","freeze","individual","pameters",",","or","individual","values","in","those","parameters",",","you","must","modify","the","`","frozen","`","attribute","of","the","tensor","or","parameter","directly",".","Default","is","False",".","verbose",":","bool",",","optional","Whether","to","print","the","improvement","and","timings","during","training","."]
docstr: Return the emission/responsibility matrix.
  
  This method returns the log probability of each example under each
  distribution contained in the model with the log prior probability
  of each component added.
  
  
  Parameters
  ----------
  X: list, tuple, numpy.ndarray, torch.Tensor, shape=(-1, self.d)
          A set of examples to evaluate. 
  
  
  Returns
  -------
  e: torch.Tensor, shape=(-1, self.k)
          A set of log probabilities for each example under each distribution.
docstr_tok: ["Return","the","emission\/responsibility","matrix",".","This","method","returns","the","log","probability","of","each","example","under","each","distribution","contained","in","the","model","with","the","log","prior","probability","of","each","component","added",".","Parameters","--","--","--","--","--","X",":","list",",","tuple",",","numpy.ndarray",",","torch.Tensor",",","shape=","(","-1",",","self.d",")","A","set","of","examples","to","evaluate",".","Returns","--","--","--","-","e",":","torch.Tensor",",","shape=","(","-1",",","self.k",")","A","set","of","log","probabilities","for","each","example","under","each","distribution","."]
code: def _emission_matrix(self, X):
      """Return the emission/responsibility matrix.
  
      This method returns the log probability of each example under each
      distribution contained in the model with the log prior probability
      of each component added.
  
  
      Parameters
      ----------
      X: list, tuple, numpy.ndarray, torch.Tensor, shape=(-1, self.d)
              A set of examples to evaluate.
  
  
      Returns
      -------
      e: torch.Tensor, shape=(-1, self.k)
              A set of log probabilities for each example under each distribution.
      """
  
      X = _check_parameter(
          _cast_as_tensor(X), "X", ndim=2, shape=(-1, self.d)
      )
  
      e = torch.empty(X.shape[0], self.d, 2, device=self.device)
      e[:, :, 0] = self._log_priors.unsqueeze(0)
      e[:, :, 0] += self.distribution.log_probability(X).unsqueeze(1)
  
      e[:, :, 1] = torch.log(1 - self.priors).unsqueeze(0)
      e[:, :, 1] += torch.where(X == 0, 0, float("-inf"))
      return e
  
file_path: pomegranate/pomegranate/distributions/zero_inflated.py
imports: import time
  import torch
  from .._utils import _cast_as_tensor
  from .._utils import _cast_as_parameter
  from .._utils import _update_parameter
  from .._utils import _check_parameter
  from .._utils import _reshape_weights
  from ._distribution import Distribution
label_desc: Use image node_id 4 for calling the ZeroInflated obj's underlying member method code with example usage: obj._emission_matrix(X) and returns: e