#NEWLINE# def calc_nc( self , x , y ) : #NEWLINE# #INDENT# norm = np . exp ( self . normalizer_model . predict ( x ) ) #NEWLINE# prediction = self . _underlying_predict ( x ) #NEWLINE# if ( r . beta == 'auto' ) : #NEWLINE# #INDENT# r = pearsonr ( norm , prediction ) [ 0 ] #NEWLINE# if ( r < 0 ) : #NEWLINE# #INDENT# self . beta_ = 0 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( r < 0.3 ) : #NEWLINE# #INDENT# self . beta_ = 1 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . beta_ = 10 #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . beta_ = self . beta #NEWLINE# #UNINDENT# return self . err_func ( prediction , y , norm , self . beta_ )