Skip to content
This repository has been archived by the owner on May 21, 2022. It is now read-only.

BalancedBatches for labeled data #4

Open
Evizero opened this issue May 2, 2017 · 1 comment
Open

BalancedBatches for labeled data #4

Evizero opened this issue May 2, 2017 · 1 comment

Comments

@Evizero
Copy link
Member

Evizero commented May 2, 2017

Would be nice to have a new data iterator that samples the given data in such a way, that each iteration a batch is returned that contains an equal amount of observations from each class (no matter the class distribution)

X = rand(2, 6) # some features
y = [:a, :a, :a, :a, :b, :b]
for (xbatch, ybatch) in BalancedBatches((X, y), size = 2, count = 10)
    # ybatch is always either [:a, :b] or [:b, :a]
end
@simonmandlik
Copy link

Agreed. I believe that now when RandomObs/RandomBatches are available, it makes sense to have BalancedBatches in addition to BalancedObs as well.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants