GitHub user gallenvara opened a pull request:
https://github.com/apache/flink/pull/1909
[FLINK-3783] [core] Support weighted random sampling with reservoir.
Thanks for contributing to Apache Flink. Before you open your pull request,
please take the following check list into consideration.
If your changes take all of the items into account, feel free to open your
pull request. For more information and/or questions please refer to the [How To
Contribute guide](http://flink.apache.org/how-to-contribute.html).
In addition to going through the list, please provide a meaningful
description of your changes.
- [X] General
- The pull request references the related JIRA issue
- The pull request addresses only one issue
- Each commit in the PR has a meaningful commit message
- [X] Documentation
- Documentation has been added for new functionality
- Old documentation affected by the pull request has been updated
- JavaDoc for public methods has been added
- [X] Tests & Build
- Functionality added by the pull request is covered by tests
- `mvn clean verify` has been executed successfully locally or a Travis
build has passed
In default random sampling, all items have the same probability to be
selected. But in weighted random sampling, the probability of each item to be
selected is determined by its weight with respect to the weights of the other
items. This is reference paper: http://arxiv.org/pdf/1012.0256.pdf. The test of
WRS is defining 10 items with different probability and counting every item in
the reservoir to get the probability after sampling and comparing with expected
probabilities to verify its correctness. Also, the paper describe method with
exponential jumps, i think we can implement it in future.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/gallenvara/flink WeightedRandomSample
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1909.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1909
----
commit 33b961602dd1d289a979869250b88a43c68ba9ab
Author: gallenvara <[email protected]>
Date: 2016-04-18T08:50:20Z
Support weighted random sampler.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---