#NEWLINE# def _derivedDistances( self , primary_distances ) : #NEWLINE# #INDENT# distances = primary_distances #NEWLINE# current_column = self . _derived_start #NEWLINE# for interaction in self . _interaction_indices : #NEWLINE# #INDENT# distances [ : , current_column ] = numpy . prod ( distances [ : , interaction ] , axis = 1 ) #NEWLINE# current_column += 1 #NEWLINE# #UNINDENT# missing_data = numpy . isnan ( distances [ : , : self ] ) #NEWLINE# distances [ : , : current_column ] [ missing_data ] = 0 #NEWLINE# if self . _missing_field_indices : #NEWLINE# #INDENT# distances [ : , current_column : ] = ( 1 - missing_data [ : , self . _missing_field_indices ] ) #NEWLINE# #UNINDENT# return distances