benmiroglio / pymatch

MIT License
276 stars 129 forks source link

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

Open tlooden opened 5 years ago

tlooden commented 5 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)