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

BalancedBatches for labeled data #4

Open

Description

@Evizero

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

Activity

  1. simonmandlik commented on Nov 20, 2017

    @simonmandlik

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions