#NEWLINE# def testInverse( self ) : #NEWLINE# #INDENT# i = np . abs ( self . v . dot ( self . w ) ) #NEWLINE# self . assertTrue ( ( ( np . abs ( np . mean ( i . diagonal ( ) ) ) - 1 ) < epsilon ) ) #NEWLINE# self . assertTrue ( ( np . abs ( ( np . sum ( i ) - i . trace ( ) ) ) < epsilon ) ) #NEWLINE# ( w , v ) = pca ( self . x , subtract_mean = True , normalize = True ) #NEWLINE# i = np . abs ( v . dot ( w ) ) #NEWLINE# self . assertTrue ( ( ( np . abs ( np . mean ( i . diagonal ( ) ) ) - 1 ) < epsilon ) ) #NEWLINE# self . assertTrue ( ( np . abs ( ( np . sum ( i ) - i . trace ( ) ) ) < epsilon ) )