Skip to content

Commit ca4556a

Browse files
committed
bug1
1 parent 8189ba7 commit ca4556a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

imblearn/under_sampling/_prototype_selection/_random_under_sampler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def _fit_resample(self, X, y):
112112
if target_class in self.sampling_strategy_.keys():
113113
n_samples = self.sampling_strategy_[target_class]
114114
index_target_class = random_state.choice(
115-
range(np.count_nonzero(y == target_class)),
115+
range(np.count_nonzero(y != target_class)),
116116
size=n_samples,
117117
replace=self.replacement,
118118
)
@@ -122,7 +122,7 @@ def _fit_resample(self, X, y):
122122
idx_under = np.concatenate(
123123
(
124124
idx_under,
125-
np.flatnonzero(y == target_class)[index_target_class],
125+
np.flatnonzero(y != target_class)[index_target_class],
126126
),
127127
axis=0,
128128
)

0 commit comments

Comments
 (0)