Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
In the current implementation, SRS takes the sampling probability in the constructor of the UDF, while SRSWR takes the sample size in the function call. The attached patch updates SRS to make it consistent with SRSWR.
After the patch, SRS takes a bag of items, a desired sampling probability, and optionally a lower bound of the size of the population as the inputs, while SRSWR takes a bag of items, a desired sample size, and optionally a lower bound of the size of the population as the inputs.
Another benefit of the patch is that user doesn't have to create multiple instances of the UDF to sample with different probabilities.