@ignore_warnings(category=DeprecationWarning)
def test_fit_predict():
 lrng = np.random.RandomState(101)
 (n_samples, n_dim, n_comps) = (100, 2, 2)
 mu = np.array([[8, 8]])
 component_0 = lrng.randn(n_samples, n_dim)
 component_1 = (lrng.randn(n_samples, n_dim) + mu)
 X = np.vstack((component_0, component_1))
 for m_constructor in (mixture.GMM, mixture.VBGMM, mixture.DPGMM):
  model = m_constructor(n_components=n_comps, covariance_type='full', min_covar=1e-07, n_iter=5, random_state=np.random.RandomState(0))
  assert_fit_predict_correct(model, X)
 model = mixture.GMM(n_components=n_comps, n_iter=0)
 z = model.fit_predict(X)
 assert np.all((z == 0)), 'Quick Initialization Failed!'

@ ignore_warnings ( category = DeprecationWarning ) def test_fit_predict ( ) : lrng = np . random . RandomState ( 101 ) ( n_samples , n_dim , n_comps ) = ( 100 , 2 , 2 ) mu = np . array ( [ [ 8 , 8 ] ] ) component_0 = lrng . randn ( n_samples , n_dim ) component_1 = ( lrng . randn ( n_samples , n_dim ) + mu ) X = np . vstack ( ( component_0 , component_1 ) ) for m_constructor in ( mixture . GMM , mixture . VBGMM , mixture . DPGMM ) : model = m_constructor ( n_components = n_comps , covariance_type = 'full' , min_covar = 1e-07 , n_iter = 5 , random_state = np . random . RandomState ( 0 ) ) assert_fit_predict_correct ( model , X ) model = mixture . GMM ( n_components = n_comps , n_iter = 0 ) z = model . fit_predict ( X ) assert np . all ( ( z == 0 ) ) , 'Quick Initialization Failed!'
test that gmm .