Skip to content

Commit

Permalink
symprod special case fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gykovacs committed Nov 25, 2023
1 parent cdf712d commit ca2d4e1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions smote_variants/oversampling/_symprod.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,9 @@ def normalize(self, array):
Returns:
np.array: the normalized array
"""
if (array.max() - array.min()) == 0.0:
array = np.repeat(0.0, len(array))
else:
array = (array - array.min()) / (array.max() - array.min())

return array
return (np.repeat(0.0, len(array))
if array.max() - array.min() < 1e-10
else (array - array.min()) / (array.max() - array.min()))

def determine_cf_norms(self, X_maj, X_min, nn_params):
"""
Expand Down

0 comments on commit ca2d4e1

Please sign in to comment.