0

Is there any way to get/show the data which is not chosen by undersampling approach?

rus = RandomUnderSampler(sampling_strategy=1, random_state=41)
x_res, y_res = rus.fit_resample(x, y)
tassaneel
  • 175
  • 2
  • 14

1 Answers1

0

Basically, this can be a little silly solution,

change your y_res & y into a list and pass it to the code below , to get the unselected data,

set1 = set(y)
set2 = set(y_res)

unselect= list(sorted(set1 - set2))

print('unselected data :', unselect)

might be other good solutions, but this can be a funny one.

Thumbs up if you like !!

Tamil Selvan
  • 1,600
  • 1
  • 9
  • 25