class_docstr: This class implements Bayesian GMMs
  
  this class contains the following fields
  k: int,
     the number of components in the mixture
  dim: int,
       the dimension of the data
  means: array of shape (k, dim)
         all the means of the components
  precisions: array of shape (k, dim, dim)
              the precisions of the components
  weights: array of shape (k):
           weights of the mixture
  shrinkage: array of shape (k):
             scaling factor of the posterior precisions on the mean
  dof: array of shape (k)
       the degrees of freedom of the components
  prior_means: array of shape (k, dim):
               the prior on the components means
  prior_scale: array of shape (k, dim):
               the prior on the components precisions
  prior_dof: array of shape (k):
              the prior on the dof (should be at least equal to dim)
  prior_shrinkage: array of shape (k):
                   scaling factor of the prior precisions on the mean
  prior_weights: array of shape (k)
                 the prior on the components weights
  shrinkage: array of shape (k):
             scaling factor of the posterior precisions on the mean
  dof : array of shape (k): the posterior dofs
  
  fixme
  -----
  only 'full' precision is supported
class_docstr_tok: ["This","class","implements","Bayesian","GMMs","this","class","contains","the","following","fields","k",":","int",",","the","number","of","components","in","the","mixture","dim",":","int",",","the","dimension","of","the","data","means",":","array","of","shape","(","k",",","dim",")","all","the","means","of","the","components","precisions",":","array","of","shape","(","k",",","dim",",","dim",")","the","precisions","of","the","components","weights",":","array","of","shape","(","k",")",":","weights","of","the","mixture","shrinkage",":","array","of","shape","(","k",")",":","scaling","factor","of","the","posterior","precisions","on","the","mean","dof",":","array","of","shape","(","k",")","the","degrees","of","freedom","of","the","components","prior_means",":","array","of","shape","(","k",",","dim",")",":","the","prior","on","the","components","means","prior_scale",":","array","of","shape","(","k",",","dim",")",":","the","prior","on","the","components","precisions","prior_dof",":","array","of","shape","(","k",")",":","the","prior","on","the","dof","(","should","be","at","least","equal","to","dim",")","prior_shrinkage",":","array","of","shape","(","k",")",":","scaling","factor","of","the","prior","precisions","on","the","mean","prior_weights",":","array","of","shape","(","k",")","the","prior","on","the","components","weights","shrinkage",":","array","of","shape","(","k",")",":","scaling","factor","of","the","posterior","precisions","on","the","mean","dof",":","array","of","shape","(","k",")",":","the","posterior","dofs","fixme","--","--","-","only","'full","'","precision","is","supported"]
docstr: Set the priors in order of having them weakly uninformative
  this is from  Fraley and raftery;
  Journal of Classification 24:155-181 (2007)
  
  Parameters
  ----------
  x, array of shape (nb_samples,self.dim)
     the data used in the estimation process
  nocheck: boolean, optional,
           if nocheck==True, check is skipped
docstr_tok: ["Set","the","priors","in","order","of","having","them","weakly","uninformative","this","is","from","Fraley","and","raftery",";","Journal","of","Classification","24:155-181","(","2007",")","Parameters","--","--","--","--","--","x",",","array","of","shape","(","nb_samples",",","self.dim",")","the","data","used","in","the","estimation","process","nocheck",":","boolean",",","optional",",","if","nocheck==True",",","check","is","skipped"]
code: def guess_priors(self, x, nocheck=0):
      """
      Set the priors in order of having them weakly uninformative
      this is from  Fraley and raftery;
      Journal of Classification 24:155-181 (2007)
  
      Parameters
      ----------
      x, array of shape (nb_samples,self.dim)
         the data used in the estimation process
      nocheck: boolean, optional,
               if nocheck==True, check is skipped
      """
      # a few parameters
      small = 0.01
      elshape = (1, self.dim, self.dim)
      mx = np.reshape(x.mean(0), (1, self.dim))
      dx = x - mx
      vx = np.dot(dx.T, dx) / x.shape[0]
      px = np.reshape(np.diag(1.0 / np.diag(vx)), elshape)
      px *= np.exp(2.0 / self.dim * math.log(self.k))
  
      # set the priors
      self.prior_means = np.repeat(mx, self.k, 0)
      self.prior_weights = np.ones(self.k)
      self.prior_scale = np.repeat(px, self.k, 0)
      self.prior_dof = np.ones(self.k) * (self.dim + 2)
      self.prior_shrinkage = np.ones(self.k) * small
  
      # cache some pre-computations
      self._dets = np.ones(self.k) * detsh(px[0])
      self._inv_prior_scale = np.repeat(
          np.reshape(inv(px[0]), elshape), self.k, 0
      )
  
      # check that everything is OK
      if nocheck == True:
          self.check()
  
imports: import math
  import numpy
  import numpy.random
  from scipy.linalg import cholesky, eigvalsh, inv
  from scipy.special import gammaln
  from .gmm import GMM
  from .utils import kmeans
label_desc: Use image node_id 4 for calling the BGMM obj's underlying member method code with example usage: obj.guess_priors(x, nocheck) without return types