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: 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 (n_samples,self.dim)
     the data used in the estimation process
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","(","n_samples",",","self.dim",")","the","data","used","in","the","estimation","process"]
code: def set_priors(self, x):
      """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 (n_samples,self.dim)
         the data used in the estimation process
      """
      # 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.maximum(1.0e-15, np.dot(dx.T, dx) / x.shape[0])
      px = np.reshape(np.diag(1.0 / np.diag(vx)), elshape)
  
      # set the priors
      self._prior_means = mx
      self.prior_means = mx
      self.prior_weights = self.alpha
      self._prior_scale = px
      self.prior_scale = px
      self._prior_dof = self.dim + 2
      self.prior_dof = [self._prior_dof]
      self._prior_shrinkage = small
      self.prior_shrinkage = [self._prior_shrinkage]
  
      # cache some pre-computations
      self._dets_ = detsh(px[0])
      self._dets = [self._dets_]
      self._inv_prior_scale_ = np.reshape(np.linalg.inv(px[0]), elshape)
      self.prior_dens = None
  
imports: import math
  import numpy
  from scipy.special import gammaln
  from .bgmm import BGMM, detsh
label_desc: Use image node_id 2 for calling the IMM obj's underlying member method code with example usage: obj.set_priors(x) without return types