#NEWLINE# def test_omp_cv( ) : #NEWLINE# #INDENT# y_ = y [ : , 0 ] #NEWLINE# gamma_ = gamma [ : , 0 ] #NEWLINE# ompcv = OrthogonalMatchingPursuitCV ( normalize = True , fit_intercept = False , max_iter = 10 , cv = 5 ) #NEWLINE# ompcv . fit ( X , y_ ) #NEWLINE# assert_equal ( y_ . n_nonzero_coefs_ , n_nonzero_coefs ) #NEWLINE# assert_array_almost_equal ( ompcv . coef_ , gamma_ ) #NEWLINE# omp = OrthogonalMatchingPursuit ( normalize = True , fit_intercept = False , n_nonzero_coefs = ompcv . n_nonzero_coefs_ ) #NEWLINE# omp . fit ( X , y_ ) #NEWLINE# assert_array_almost_equal ( ompcv . coef_ , omp . coef_ )