Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added sampling functionality #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kb18951452
Copy link

No description provided.

if(samplingPercent == 0) {
var increment = 0;
} else {
var increment = 100/samplingPercent;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's type cast this to integer so that increment is a natural number always.
Also I think we should have a condition samplingPercent > 0 and <= 100 and then we can run a for loop inside it.
Also would be good to break this into two separate functions one for filtering and other for sampling. Filtering one returns filtered + tobesampled records and takes records as input
while sampling one takes tobesampled records and sampling percent as input and returns sampled records
later on we merge the filtered and sampled records

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

Successfully merging this pull request may close these issues.

2 participants