#NEWLINE# def test_dim_reduction( self ) : #NEWLINE# #INDENT# decomposer = decomposition . PCA ( n_components = 2 ) #NEWLINE# f = combo . DimensionReduction ( [ 'a' , 'b' , 'c' ] , decomposer = decomposer ) #NEWLINE# ( data , ff ) = build_feature_safe ( f , self . data ) #NEWLINE# self . assertEqual ( data . shape , ( len ( self . data ) , 2 ) ) #NEWLINE# decomposer = decomposition . PCA ( n_components = 2 ) #NEWLINE# expected = decomposer . fit_transform ( self . data [ [ 'a' , 'b' , 'c' ] ] ) #NEWLINE# assert_almost_equal ( expected , data . values )