#NEWLINE# @ ignore_warnings #NEWLINE# def test_nmf_inverse_transform( ) : #NEWLINE# #INDENT# random_state = np . random . RandomState ( 0 ) #NEWLINE# A = np . abs ( random_state . randn ( 6 , 4 ) ) #NEWLINE# for solver in ( 'pg' , 'cd' ) : #NEWLINE# #INDENT# m = NMF ( solver = solver , n_components = 4 , init = 'random' , random_state = 0 ) #NEWLINE# ft = m . fit_transform ( A ) #NEWLINE# t = m . transform ( A ) #NEWLINE# A_new = m . inverse_transform ( t ) #NEWLINE# assert_array_almost_equal ( A , A_new , decimal = 2 )