Skip to content

Commit

Permalink
Address the problem of ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Lemaitre committed Jun 7, 2016
1 parent 843bc85 commit 01ba4c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions unbalanced_dataset/base_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ def __init__(self, ratio='auto', random_state=None, verbose=True):
# over the number of samples in the majority class. Thus, the ratio
# cannot be greater than 1.0
if isinstance(ratio, float):
if ratio > 1.0:
if ratio > 1:
raise ValueError('Ration cannot be greater than one.')
elif ratio < 0.:
elif ratio <= 0:
raise ValueError('Ratio cannot be negative.')
else:
self.ratio_ = ratio
Expand Down

0 comments on commit 01ba4c1

Please sign in to comment.