Skip to content
Discussion options

You must be logged in to vote

Besides via pre_filter, you can also do this post-processing:

data_list = []
num_classes = defaultdict(lambda: 0)
for data ind dataset:
   if num_classes[data.y] < 20:
       data_list.append(data)
       num_classes[data.y] += 1

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@MatteoGioia
Comment options

@rusty1s
Comment options

@MatteoGioia
Comment options

@rusty1s
Comment options

Answer selected by MatteoGioia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants