class_docstr: The class implements Infinite Gaussian Mixture model
  or Dirichlet Process Mixture model.
  This is simply a generalization of Bayesian Gaussian Mixture Models
  with an unknown number of classes.
class_docstr_tok: ["The","class","implements","Infinite","Gaussian","Mixture","model","or","Dirichlet","Process","Mixture","model",".","This","is","simply","a","generalization","of","Bayesian","Gaussian","Mixture","Models","with","an","unknown","number","of","classes","."]
docstr: Sample the indicator from the likelihood
  
  Parameters
  ----------
  like: array of shape (nbitem,self.k)
     component-wise likelihood
  
  Returns
  -------
  z: array of shape(nbitem): a draw of the membership variable
  
  Notes
  -----
  The behaviour is different from standard bgmm in that z can take
  arbitrary values
docstr_tok: ["Sample","the","indicator","from","the","likelihood","Parameters","--","--","--","--","--","like",":","array","of","shape","(","nbitem",",","self.k",")","component-wise","likelihood","Returns","--","--","--","-","z",":","array","of","shape","(","nbitem",")",":","a","draw","of","the","membership","variable","Notes","--","--","-","The","behaviour","is","different","from","standard","bgmm","in","that","z","can","take","arbitrary","values"]
code: def sample_indicator(self, like):
      """Sample the indicator from the likelihood
  
      Parameters
      ----------
      like: array of shape (nbitem,self.k)
         component-wise likelihood
  
      Returns
      -------
      z: array of shape(nbitem): a draw of the membership variable
  
      Notes
      -----
      The behaviour is different from standard bgmm in that z can take
      arbitrary values
      """
      z = BGMM.sample_indicator(self, like)
      z[z == self.k] = self.k + np.arange(np.sum(z == self.k))
      return z
  
imports: import math
  import numpy
  from scipy.special import gammaln
  from .bgmm import BGMM, detsh
label_desc: Use image node_id 10 for calling the IMM obj's underlying member method code with example usage: obj.sample_indicator(like) and returns: z