#NEWLINE# def threshold( self , data_1 , data_2 , recall_weight = 1.5 ) : #NEWLINE# #INDENT# '\n        Returns the threshold that maximizes the expected F score,\n        a weighted average of precision and recall for a sample of\n        data.\n\n        Arguments:\n        data_1        --  Dictionary of records from first dataset, where the\n                          keys are record_ids and the values are dictionaries\n                          with the keys being field names\n\n        data_2        --  Dictionary of records from second dataset, same form\n                          as data_1\n\n        recall_weight -- Sets the tradeoff between precision and\n                         recall. I.e. if you care twice as much about\n                         recall as you do precision, set recall_weight\n                         to 2.\n        ' #NEWLINE# blocked_pairs = self . _blockData ( data_2 , data_2 ) #NEWLINE# return self . thresholdBlocks ( blocked_pairs , recall_weight )