benmiroglio / pymatch

MIT License
272 stars 128 forks source link

'threshold' parameter in match not used when method='min' #26

Open tlooden opened 4 years ago

tlooden commented 4 years ago

Hi,

For the function matcher.match I'm wondering if there is a reason why the parameter for threshold is only used for method=='random' ? See below:

if method == 'random':
                bool_match = abs(ctrl_scores - score) <= threshold
                matches = ctrl_scores.loc[bool_match[bool_match.scores].index]
            elif method == 'min':
                matches = abs(ctrl_scores - score).sort_values('scores').head(nmatches)