lundi 26 octobre 2015

Sampling of fraction of a data with python

I have a RESTful web service- for which I wish to pick up 30% of the random requests which I need for training. Very easy to achieve- but I don't want to do any bookkeeping for the same- which adds an overhead. On a small scale this "small" overhead won't matter- but in case of internet scalability- this would be undesirable. Would anybody have any idea how I can achieve the same without the use of any counter?

PS: The sampling is unbiased- and all the requests can be treated as same. Currently I am maintaining a counter in the Django Middleware.




Aucun commentaire:

Enregistrer un commentaire