code: def test_vbgmm():
      """perform the estimation of a variational gmm"""
      n_samples, dim, offset, k = 100, 2, 2, 2
      x = nr.randn(n_samples, dim)
      x[:30] += offset
      b = VBGMM(k, dim)
      b.guess_priors(x)
      b.initialize(x)
      b.estimate(x)
      z = b.map_label(x)
  
      # fixme : find a less trivial test
      assert z.max() + 1 == b.k
  
file_path: nipy/nipy/algorithms/clustering/tests/test_bgmm.py
imports: import numpy
  import numpy.random
  from ..bgmm import BGMM, VBGMM, dirichlet_eval, dkl_gaussian, multinomial
label_desc: Use image node_id 8 for calling a global function with example usage: test_vbgmm() without return types