code: def test_em_selection():
      # test that the basic GMM-based model selection tool
      # returns something sensible
      # (i.e. the gmm used to represent the data has indeed one or two classes)
      dim = 2
      x = np.concatenate(
          (nr.randn(100, dim), 3 + 2 * nr.randn(100, dim))
      )
  
      krange = list(range(1, 10))
      lgmm = best_fitting_GMM(
          x, krange, prec_type="full", niter=100, delta=1.0e-4, ninit=1
      )
      assert lgmm.k < 4
  
file_path: nipy/nipy/algorithms/clustering/tests/test_gmm.py
imports: import numpy
  from ..gmm import GMM, best_fitting_GMM
label_desc: Use image node_id 8 for calling a global function with example usage: test_em_selection() without return types