Skip to content

r.sample() changes #2289

Open
Open

Description

@wojons

The r.sample needs 2 to 3 premature to be really useful. It may even make it easier to program.

limit, sample size, sample rate.

For example. r.sample(100,5,2) could mean. for every 5 documents randomly pick to. but never take more than 100.

I think it may be better to put the total take away outside of the sample so it would be handled like.

r.sample(5, 2).limit(100) this way the it would still mean the same thing but would be using normal reql language.

Activity

  1. coffeemug commented on Apr 22, 2014

    @coffeemug
    Contributor

    Hmm, @wojons -- could you give some examples of why it would be useful? I'm having trouble imagining the use case where something like this would be helpful. Do you have one in mind?

  2. wojons commented on Apr 22, 2014

    @wojons
    ContributorAuthor

    @coffeemug

    The current sample will grab 100 records using random distrobution. which is great. But if you know something about your data. lets say you have 600 minutes of data and you wanna take 1 minute sample for every 5 minutes of data. for that 300 of that 600 values the method i suggested would allow that. your able to control that its every 5 minutes it will pick one of the values insteed of just total random sample. if someone still wants to just get a random sample in any order they would just use r.sample().limit(60)

  3. coffeemug commented on Apr 22, 2014

    @coffeemug
    Contributor

    Got it, that's really cool. Marking as a reql proposal and putting in subsequent. We'll try to get to it soon.

  4. added this to the subsequent milestone on Apr 22, 2014
  5. coffeemug commented on Jun 7, 2014

    @coffeemug
    Contributor

    Bumping -- talking to @wojons about this now. Also, we'd need a more efficient implementation.

  6. srh commented on Jun 7, 2014

    @srh
    Contributor

    This would probably be implementable using zip, filter, and r.random, if we had r.range(...).

  7. Unitech commented on Oct 14, 2014

    @Unitech

    +2!

  8. pilwon commented on Dec 11, 2014

    @pilwon

    +:100:

  9. mbroadst commented on Jul 1, 2015

    @mbroadst
    Contributor

    I'll second that +:100:

  10. mholt commented on Feb 9, 2018

    @mholt

    Yes, this would be fantastic! (I know it's been like 3 years but I just had to add my support of this motion.) If anyone has time to work on it, I think a lot of us would appreciate it. 😄

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions