recordlinkage icon indicating copy to clipboard operation
recordlinkage copied to clipboard

threshold in at compere is broken

Open skuam opened this issue 3 years ago • 0 comments

I am referring to this code as NumPy array no longer have method where, and you get error

   c = c.where((c < self.threshold) | (pandas.isnull(c)), other=1.0)
AttributeError: 'numpy.ndarray' object has no attribute "where"
	
if self.threshold is not None:
         c = c.where((c < self.threshold) | (pandas.isnull(c)), other=1.0)
         c = c.where((c >= self.threshold) | (pandas.isnull(c)), other=0.0)

in https://github.com/J535D165/recordlinkage/blob/5b3230f5cff92ef58968eedc451735e972035793/recordlinkage/compare.py#L152

much cleaner solution would to just use this instead this

if self.threshold is not None:
         c = c >= self.threshold
         c= c.astype(float)

skuam avatar Aug 18 '21 21:08 skuam